go update
This commit is contained in:
parent
c7ffc9adc7
commit
c228c32f6c
5 changed files with 545 additions and 1150 deletions
237
caddyapp/go.mod
237
caddyapp/go.mod
|
|
@ -1,137 +1,158 @@
|
||||||
module codeberg.org/saces/caddy-dns01/caddyapp
|
module codeberg.org/saces/caddy-dns01/caddyapp
|
||||||
|
|
||||||
go 1.20
|
go 1.26
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/caddyserver/caddy/v2 v2.6.4
|
github.com/caddyserver/caddy/v2 v2.10.2
|
||||||
github.com/libdns/libdns v0.2.1
|
github.com/libdns/libdns v1.1.1
|
||||||
github.com/miekg/dns v1.1.50
|
github.com/miekg/dns v1.1.72
|
||||||
go.uber.org/zap v1.24.0
|
go.uber.org/zap v1.27.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
filippo.io/edwards25519 v1.0.0 // indirect
|
cel.dev/expr v0.25.1 // indirect
|
||||||
|
cloud.google.com/go/auth v0.18.2 // indirect
|
||||||
|
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
|
||||||
|
cloud.google.com/go/compute/metadata v0.9.0 // indirect
|
||||||
|
dario.cat/mergo v1.0.2 // indirect
|
||||||
|
filippo.io/bigmod v0.1.0 // indirect
|
||||||
|
filippo.io/edwards25519 v1.1.0 // indirect
|
||||||
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 // indirect
|
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 // indirect
|
||||||
github.com/BurntSushi/toml v1.2.1 // indirect
|
github.com/BurntSushi/toml v1.6.0 // indirect
|
||||||
|
github.com/KimMachineGun/automemlimit v0.7.5 // indirect
|
||||||
github.com/Masterminds/goutils v1.1.1 // indirect
|
github.com/Masterminds/goutils v1.1.1 // indirect
|
||||||
github.com/Masterminds/semver/v3 v3.2.0 // indirect
|
github.com/Masterminds/semver/v3 v3.4.0 // indirect
|
||||||
github.com/Masterminds/sprig/v3 v3.2.3 // indirect
|
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
|
||||||
github.com/Microsoft/go-winio v0.6.0 // indirect
|
github.com/alecthomas/chroma/v2 v2.23.1 // indirect
|
||||||
github.com/alecthomas/chroma/v2 v2.5.0 // indirect
|
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
|
||||||
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect
|
|
||||||
github.com/aryann/difflib v0.0.0-20210328193216-ff5ff6dc229b // indirect
|
github.com/aryann/difflib v0.0.0-20210328193216-ff5ff6dc229b // indirect
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/caddyserver/certmagic v0.17.2 // indirect
|
github.com/caddyserver/certmagic v0.25.1 // indirect
|
||||||
github.com/cenkalti/backoff/v4 v4.1.2 // indirect
|
github.com/caddyserver/zerossl v0.1.4 // indirect
|
||||||
|
github.com/ccoveille/go-safecast/v2 v2.0.0 // indirect
|
||||||
|
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
||||||
github.com/cespare/xxhash v1.1.0 // indirect
|
github.com/cespare/xxhash v1.1.0 // indirect
|
||||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
|
github.com/chzyer/readline v1.5.1 // indirect
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
|
github.com/cloudflare/circl v1.6.3 // indirect
|
||||||
|
github.com/coreos/go-oidc/v3 v3.17.0 // indirect
|
||||||
|
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
|
||||||
github.com/dgraph-io/badger v1.6.2 // indirect
|
github.com/dgraph-io/badger v1.6.2 // indirect
|
||||||
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
|
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
|
||||||
github.com/dgraph-io/ristretto v0.1.0 // indirect
|
github.com/dgraph-io/ristretto v0.2.0 // indirect
|
||||||
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
|
github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da // indirect
|
||||||
github.com/dlclark/regexp2 v1.7.0 // indirect
|
github.com/dlclark/regexp2 v1.11.5 // indirect
|
||||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||||
github.com/felixge/httpsnoop v1.0.3 // indirect
|
github.com/felixge/httpsnoop v1.0.4 // indirect
|
||||||
github.com/fxamacker/cbor/v2 v2.4.0 // indirect
|
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
|
||||||
github.com/go-chi/chi v4.1.2+incompatible // indirect
|
github.com/go-chi/chi/v5 v5.2.5 // indirect
|
||||||
github.com/go-kit/kit v0.10.0 // indirect
|
github.com/go-jose/go-jose/v3 v3.0.4 // indirect
|
||||||
github.com/go-logfmt/logfmt v0.5.1 // indirect
|
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
|
||||||
github.com/go-logr/logr v1.2.3 // indirect
|
github.com/go-logr/logr v1.4.3 // indirect
|
||||||
github.com/go-logr/stdr v1.2.2 // indirect
|
github.com/go-logr/stdr v1.2.2 // indirect
|
||||||
github.com/go-sql-driver/mysql v1.6.0 // indirect
|
github.com/go-sql-driver/mysql v1.9.3 // indirect
|
||||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
|
github.com/golang/protobuf v1.5.4 // indirect
|
||||||
github.com/golang/glog v1.0.0 // indirect
|
github.com/golang/snappy v1.0.0 // indirect
|
||||||
github.com/golang/mock v1.6.0 // indirect
|
github.com/google/cel-go v0.27.0 // indirect
|
||||||
github.com/golang/protobuf v1.5.2 // indirect
|
github.com/google/certificate-transparency-go v1.3.2 // indirect
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/google/go-tpm v0.9.8 // indirect
|
||||||
github.com/google/cel-go v0.13.0 // indirect
|
github.com/google/go-tspi v0.3.0 // indirect
|
||||||
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
|
github.com/google/s2a-go v0.1.9 // indirect
|
||||||
github.com/google/uuid v1.3.0 // indirect
|
github.com/google/uuid v1.6.0 // indirect
|
||||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
|
github.com/googleapis/enterprise-certificate-proxy v0.3.12 // indirect
|
||||||
github.com/huandu/xstrings v1.3.3 // indirect
|
github.com/googleapis/gax-go/v2 v2.17.0 // indirect
|
||||||
github.com/imdario/mergo v0.3.12 // indirect
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.8 // indirect
|
||||||
github.com/inconshreveable/mousetrap v1.0.1 // indirect
|
github.com/huandu/xstrings v1.5.0 // indirect
|
||||||
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
github.com/jackc/pgconn v1.13.0 // indirect
|
|
||||||
github.com/jackc/pgio v1.0.0 // indirect
|
|
||||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||||
github.com/jackc/pgproto3/v2 v2.3.1 // indirect
|
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||||
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
|
github.com/jackc/pgx/v5 v5.8.0 // indirect
|
||||||
github.com/jackc/pgtype v1.12.0 // indirect
|
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
||||||
github.com/jackc/pgx/v4 v4.17.2 // indirect
|
github.com/klauspost/compress v1.18.4 // indirect
|
||||||
github.com/klauspost/compress v1.15.15 // indirect
|
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
|
||||||
github.com/klauspost/cpuid/v2 v2.2.3 // indirect
|
|
||||||
github.com/manifoldco/promptui v0.9.0 // indirect
|
github.com/manifoldco/promptui v0.9.0 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.8 // indirect
|
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.13 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
|
|
||||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
|
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
|
||||||
github.com/mholt/acmez v1.1.0 // indirect
|
github.com/mholt/acmez/v3 v3.1.4 // indirect
|
||||||
github.com/micromdm/scep/v2 v2.1.0 // indirect
|
|
||||||
github.com/mitchellh/copystructure v1.2.0 // indirect
|
github.com/mitchellh/copystructure v1.2.0 // indirect
|
||||||
github.com/mitchellh/go-ps v1.0.0 // indirect
|
github.com/mitchellh/go-ps v1.0.0 // indirect
|
||||||
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
||||||
github.com/onsi/ginkgo/v2 v2.2.0 // indirect
|
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||||
|
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
|
||||||
|
github.com/pires/go-proxyproto v0.11.0 // indirect
|
||||||
github.com/pkg/errors v0.9.1 // indirect
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
github.com/prometheus/client_golang v1.14.0 // indirect
|
github.com/prometheus/client_golang v1.23.2 // indirect
|
||||||
github.com/prometheus/client_model v0.3.0 // indirect
|
github.com/prometheus/client_model v0.6.2 // indirect
|
||||||
github.com/prometheus/common v0.37.0 // indirect
|
github.com/prometheus/common v0.67.5 // indirect
|
||||||
github.com/prometheus/procfs v0.8.0 // indirect
|
github.com/prometheus/procfs v0.19.2 // indirect
|
||||||
github.com/quic-go/qpack v0.4.0 // indirect
|
github.com/quic-go/qpack v0.6.0 // indirect
|
||||||
github.com/quic-go/qtls-go1-18 v0.2.0 // indirect
|
github.com/quic-go/quic-go v0.59.0 // indirect
|
||||||
github.com/quic-go/qtls-go1-19 v0.2.0 // indirect
|
github.com/rs/xid v1.6.0 // indirect
|
||||||
github.com/quic-go/qtls-go1-20 v0.1.0 // indirect
|
|
||||||
github.com/quic-go/quic-go v0.32.0 // indirect
|
|
||||||
github.com/rs/xid v1.4.0 // indirect
|
|
||||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||||
github.com/shopspring/decimal v1.2.0 // indirect
|
github.com/shopspring/decimal v1.4.0 // indirect
|
||||||
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
|
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
|
||||||
github.com/sirupsen/logrus v1.9.0 // indirect
|
github.com/sirupsen/logrus v1.9.4 // indirect
|
||||||
github.com/slackhq/nebula v1.6.1 // indirect
|
github.com/slackhq/nebula v1.10.3 // indirect
|
||||||
github.com/smallstep/certificates v0.23.2 // indirect
|
github.com/smallstep/certificates v0.29.0 // indirect
|
||||||
github.com/smallstep/nosql v0.5.0 // indirect
|
github.com/smallstep/cli-utils v0.12.2 // indirect
|
||||||
github.com/smallstep/truststore v0.12.1 // indirect
|
github.com/smallstep/go-attestation v0.4.4-0.20241119153605-2306d5b464ca // indirect
|
||||||
github.com/spf13/cast v1.4.1 // indirect
|
github.com/smallstep/linkedca v0.25.0 // indirect
|
||||||
github.com/spf13/cobra v1.6.1 // indirect
|
github.com/smallstep/nosql v0.7.0 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/smallstep/pkcs7 v0.2.1 // indirect
|
||||||
github.com/stoewer/go-strcase v1.2.0 // indirect
|
github.com/smallstep/scep v0.0.0-20250318231241-a25cabb69492 // indirect
|
||||||
github.com/tailscale/tscert v0.0.0-20230124224810-c6dc1f4049b2 // indirect
|
github.com/smallstep/truststore v0.13.0 // indirect
|
||||||
github.com/urfave/cli v1.22.12 // indirect
|
github.com/spf13/cast v1.10.0 // indirect
|
||||||
|
github.com/spf13/cobra v1.10.2 // indirect
|
||||||
|
github.com/spf13/pflag v1.0.10 // indirect
|
||||||
|
github.com/tailscale/go-winio v0.0.0-20231025203758-c4f33415bf55 // indirect
|
||||||
|
github.com/tailscale/tscert v0.0.0-20251216020129-aea342f6d747 // indirect
|
||||||
|
github.com/urfave/cli v1.22.17 // indirect
|
||||||
github.com/x448/float16 v0.8.4 // indirect
|
github.com/x448/float16 v0.8.4 // indirect
|
||||||
github.com/yuin/goldmark v1.5.4 // indirect
|
github.com/yuin/goldmark v1.7.16 // indirect
|
||||||
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20220924101305-151362477c87 // indirect
|
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc // indirect
|
||||||
go.etcd.io/bbolt v1.3.6 // indirect
|
github.com/zeebo/blake3 v0.2.4 // indirect
|
||||||
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 // indirect
|
go.etcd.io/bbolt v1.4.3 // indirect
|
||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.39.0 // indirect
|
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
||||||
go.opentelemetry.io/otel v1.13.0 // indirect
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.4.0 // indirect
|
go.opentelemetry.io/contrib/propagators/autoprop v0.65.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.0 // indirect
|
go.opentelemetry.io/contrib/propagators/aws v1.40.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.4.0 // indirect
|
go.opentelemetry.io/contrib/propagators/b3 v1.40.0 // indirect
|
||||||
go.opentelemetry.io/otel/metric v0.36.0 // indirect
|
go.opentelemetry.io/contrib/propagators/jaeger v1.40.0 // indirect
|
||||||
go.opentelemetry.io/otel/sdk v1.13.0 // indirect
|
go.opentelemetry.io/contrib/propagators/ot v1.40.0 // indirect
|
||||||
go.opentelemetry.io/otel/trace v1.13.0 // indirect
|
go.opentelemetry.io/otel v1.40.0 // indirect
|
||||||
go.opentelemetry.io/proto/otlp v0.12.0 // indirect
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0 // indirect
|
||||||
go.step.sm/cli-utils v0.7.5 // indirect
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0 // indirect
|
||||||
go.step.sm/crypto v0.23.2 // indirect
|
go.opentelemetry.io/otel/metric v1.40.0 // indirect
|
||||||
go.step.sm/linkedca v0.19.0 // indirect
|
go.opentelemetry.io/otel/sdk v1.40.0 // indirect
|
||||||
go.uber.org/atomic v1.9.0 // indirect
|
go.opentelemetry.io/otel/trace v1.40.0 // indirect
|
||||||
go.uber.org/multierr v1.6.0 // indirect
|
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
|
||||||
golang.org/x/crypto v0.5.0 // indirect
|
go.step.sm/crypto v0.76.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20221205204356-47842c84f3db // indirect
|
go.uber.org/automaxprocs v1.6.0 // indirect
|
||||||
golang.org/x/mod v0.6.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
golang.org/x/net v0.7.0 // indirect
|
go.uber.org/zap/exp v0.3.0 // indirect
|
||||||
golang.org/x/sync v0.1.0 // indirect
|
go.yaml.in/yaml/v2 v2.4.3 // indirect
|
||||||
golang.org/x/sys v0.5.0 // indirect
|
go.yaml.in/yaml/v3 v3.0.4 // indirect
|
||||||
golang.org/x/term v0.5.0 // indirect
|
golang.org/x/crypto v0.48.0 // indirect
|
||||||
golang.org/x/text v0.7.0 // indirect
|
golang.org/x/crypto/x509roots/fallback v0.0.0-20260213171211-a408498e5541 // indirect
|
||||||
golang.org/x/tools v0.2.0 // indirect
|
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect
|
||||||
google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 // indirect
|
golang.org/x/mod v0.33.0 // indirect
|
||||||
google.golang.org/grpc v1.52.3 // indirect
|
golang.org/x/net v0.50.0 // indirect
|
||||||
google.golang.org/protobuf v1.28.1 // indirect
|
golang.org/x/oauth2 v0.35.0 // indirect
|
||||||
|
golang.org/x/sync v0.19.0 // indirect
|
||||||
|
golang.org/x/sys v0.41.0 // indirect
|
||||||
|
golang.org/x/term v0.40.0 // indirect
|
||||||
|
golang.org/x/text v0.34.0 // indirect
|
||||||
|
golang.org/x/time v0.14.0 // indirect
|
||||||
|
golang.org/x/tools v0.42.0 // indirect
|
||||||
|
google.golang.org/api v0.266.0 // indirect
|
||||||
|
google.golang.org/genproto v0.0.0-20260209200024-4cfbd4190f57 // indirect
|
||||||
|
google.golang.org/genproto/googleapis/api v0.0.0-20260209200024-4cfbd4190f57 // indirect
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 // indirect
|
||||||
|
google.golang.org/grpc v1.79.1 // indirect
|
||||||
|
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.1 // indirect
|
||||||
|
google.golang.org/protobuf v1.36.11 // indirect
|
||||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
|
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
|
||||||
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
|
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
howett.net/plist v1.0.0 // indirect
|
howett.net/plist v1.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
|
|
||||||
1415
caddyapp/go.sum
1415
caddyapp/go.sum
File diff suppressed because it is too large
Load diff
|
|
@ -209,14 +209,16 @@ func log_RR(enc zapcore.ObjectEncoder, rr dns.RR) {
|
||||||
|
|
||||||
func log_libdns_record(record *libdns.Record) zapcore.ObjectMarshaler {
|
func log_libdns_record(record *libdns.Record) zapcore.ObjectMarshaler {
|
||||||
f := func(enc zapcore.ObjectEncoder) error {
|
f := func(enc zapcore.ObjectEncoder) error {
|
||||||
enc.AddString("ID", record.ID)
|
// enc.AddString("ID", (*record).RR().ID)
|
||||||
enc.AddString("type", record.Type)
|
enc.AddString("type", (*record).RR().Type)
|
||||||
enc.AddString("name", record.Name)
|
enc.AddString("name", (*record).RR().Name)
|
||||||
enc.AddString("value", record.Value)
|
enc.AddString("TTL", (*record).RR().TTL.String())
|
||||||
enc.AddString("TTL", record.TTL.String())
|
enc.AddString("data", (*record).RR().Data)
|
||||||
|
/*
|
||||||
if record.Priority != 0 {
|
if record.Priority != 0 {
|
||||||
enc.AddInt("priority", record.Priority)
|
enc.AddInt("priority", record.Priority)
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return zapcore.ObjectMarshalerFunc(f)
|
return zapcore.ObjectMarshalerFunc(f)
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,8 @@ func (Provider) CaddyModule() caddy.ModuleInfo {
|
||||||
// Provision sets up the module. Implements caddy.Provisioner.
|
// Provision sets up the module. Implements caddy.Provisioner.
|
||||||
func (p *Provider) Provision(ctx caddy.Context) error {
|
func (p *Provider) Provision(ctx caddy.Context) error {
|
||||||
p.logger = ctx.Logger()
|
p.logger = ctx.Logger()
|
||||||
if !ctx.AppIsConfigured("dns") {
|
_, err := ctx.AppIfConfigured("dns")
|
||||||
|
if err != nil {
|
||||||
p.logger.Warn("DNS app not yet configured")
|
p.logger.Warn("DNS app not yet configured")
|
||||||
}
|
}
|
||||||
app, err := ctx.App("dns")
|
app, err := ctx.App("dns")
|
||||||
|
|
|
||||||
|
|
@ -25,23 +25,25 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func record_to_rr(zone string, record libdns.Record) (dns.RR, error) {
|
func record_to_rr(zone string, record libdns.Record) (dns.RR, error) {
|
||||||
|
/*
|
||||||
maybe_priority := ""
|
maybe_priority := ""
|
||||||
if record.Priority != 0 {
|
if record.Priority != 0 {
|
||||||
maybe_priority += strconv.FormatInt(int64(record.Priority), 10)
|
maybe_priority += strconv.FormatInt(int64(record.Priority), 10)
|
||||||
maybe_priority += " "
|
maybe_priority += " "
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
//TODO: consider fixing this with dns.StringToType & dns.TypeToRR
|
//TODO: consider fixing this with dns.StringToType & dns.TypeToRR
|
||||||
// Problem is putting the value in, since it will be a different field
|
// Problem is putting the value in, since it will be a different field
|
||||||
// for every type.
|
// for every type.
|
||||||
// Also, will probably require parsing the value anyway (e.g. to net.IP)
|
// Also, will probably require parsing the value anyway (e.g. to net.IP)
|
||||||
//TODO: does the value need to be escaped?!
|
//TODO: does the value need to be escaped?!
|
||||||
return dns.NewRR(
|
return dns.NewRR(
|
||||||
dns.Fqdn(record.Name+"."+zone) +
|
dns.Fqdn(record.RR().Name+"."+zone) +
|
||||||
" " +
|
" " +
|
||||||
strconv.FormatInt(int64(record.TTL.Seconds()), 10) +
|
strconv.FormatInt(int64(record.RR().TTL.Seconds()), 10) +
|
||||||
" IN " +
|
" IN " +
|
||||||
record.Type +
|
record.RR().Type +
|
||||||
" " +
|
" " +
|
||||||
maybe_priority +
|
// maybe_priority +
|
||||||
record.Value)
|
record.RR().Data)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue