dns_api

package module
v0.0.0-...-a6ad95f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExpirationTimeNever = 0
	KeyPublicKey        = "k"
	KeyExpiration       = "x"
	KeySignature        = "s"
)

Variables

View Source
var TopLevelCNAMEError = errors.New("top-level CNAME not allowed")

Functions

func BuildSignatureMessage

func BuildSignatureMessage(method string, host string, requestUrl *url.URL) ([]byte, ed25519.PublicKey, int64, error)

func CreateSignatureMessage

func CreateSignatureMessage(method string, host string, requestUrl *url.URL, privateKey ed25519.PrivateKey, expirationTime time.Time) (*url.URL, error)

func DecodePrivateKey

func DecodePrivateKey(buf string) ed25519.PrivateKey

func DecodeTorPrivateKey

func DecodeTorPrivateKey(key string) ed25519.PrivateKey

func PublicKeyToOnionV3

func PublicKeyToOnionV3(publicKey ed25519.PublicKey) string

func VerifySignatureMessage

func VerifySignatureMessage(method string, host string, requestUrl *url.URL) (ed25519.PublicKey, error)

Types

type Client

type Client struct {
	RequestExpirationTime time.Duration
	// contains filtered or unexported fields
}

func NewClient

func NewClient(privateKey ed25519.PrivateKey, client *http.Client) *Client

NewClient Creates an API client with either a specified http Client, or nil

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

type RRSet

type RRSet []dns.RR

func DecodeRRSet

func DecodeRRSet(buf []byte) (result RRSet, err error)

func (RRSet) Delete

func (s RRSet) Delete(rrt uint16, name string)

func (RRSet) Encode

func (s RRSet) Encode() (result []byte, err error)

func (RRSet) Get

func (s RRSet) Get(rrt uint16, name string) (rrset RRSet)

func (RRSet) NotNil

func (s RRSet) NotNil() (result RRSet)

func (RRSet) OnlyTypes

func (s RRSet) OnlyTypes(allow ...uint16) (result RRSet)

func (RRSet) RemoveTypes

func (s RRSet) RemoveTypes(disallow ...uint16) (result RRSet)

func (RRSet) SplitByName

func (s RRSet) SplitByName() (result []RRSet)

func (RRSet) SplitByType

func (s RRSet) SplitByType() (result []RRSet)

type Zone

type Zone struct {
	// contains filtered or unexported fields
}

func NewZoneFromPrivateKey

func NewZoneFromPrivateKey(baseZone string, privateKey ed25519.PrivateKey) *Zone

func NewZoneFromPublicKey

func NewZoneFromPublicKey(baseZone string, publicKey ed25519.PublicKey) *Zone

func (*Zone) AddMissingRecords

func (z *Zone) AddMissingRecords()

func (*Zone) AddRR

func (z *Zone) AddRR(rr dns.RR) error

func (*Zone) AddRecord

func (z *Zone) AddRecord(name string, ttl uint32, rr dns.RR) error

func (*Zone) AddRecordA

func (z *Zone) AddRecordA(name string, ip net.IP, ttl uint32) error

func (*Zone) AddRecordAAAA

func (z *Zone) AddRecordAAAA(name string, ip net.IP, ttl uint32) error

func (*Zone) AddRecordCAA

func (z *Zone) AddRecordCAA(name string, flag uint8, tag, value string, ttl uint32) error

func (*Zone) AddRecordCNAME

func (z *Zone) AddRecordCNAME(name string, target string, ttl uint32) error

func (*Zone) AddRecordHTTPS

func (z *Zone) AddRecordHTTPS(name string, priority uint16, target string, value []dns.SVCBKeyValue, ttl uint32) error

func (*Zone) AddRecordMX

func (z *Zone) AddRecordMX(name string, preference uint16, mx string, ttl uint32) error

func (*Zone) AddRecordNS

func (z *Zone) AddRecordNS(name string, ns string, ttl uint32) error

func (*Zone) AddRecordSOA

func (z *Zone) AddRecordSOA(name string, ns, mbox string, serial, refresh, retry, expire, minttl, ttl uint32) error

func (*Zone) AddRecordSSHFP

func (z *Zone) AddRecordSSHFP(name string, algorithm, ktype uint8, fingerprint string, ttl uint32) error

func (*Zone) AddRecordSVCB

func (z *Zone) AddRecordSVCB(name string, priority uint16, target string, value []dns.SVCBKeyValue, ttl uint32) error

func (*Zone) AddRecordTLSA

func (z *Zone) AddRecordTLSA(name string, usage, selector, matchingType uint8, certificate string, ttl uint32) error

func (*Zone) AddRecordTXT

func (z *Zone) AddRecordTXT(name string, txt []string, ttl uint32) error

func (*Zone) AddZoneAlias

func (z *Zone) AddZoneAlias(alias string)

func (*Zone) BaseZoneName

func (z *Zone) BaseZoneName() string

func (*Zone) DNSKEY

func (z *Zone) DNSKEY() *dns.DNSKEY

func (*Zone) DeleteRR

func (z *Zone) DeleteRR(rrtype string, name string) error

func (*Zone) GetEnforcedEntries

func (z *Zone) GetEnforcedEntries() RRSet

func (*Zone) GetFullName

func (z *Zone) GetFullName(name string) string

func (*Zone) GetGlueRecords

func (z *Zone) GetGlueRecords() (result RRSet)

func (*Zone) GetRR

func (z *Zone) GetRR(rrtype string, name string) (rrset RRSet)

func (*Zone) GetRRSet

func (z *Zone) GetRRSet() RRSet

func (*Zone) IsInZone

func (z *Zone) IsInZone(n string) bool

func (*Zone) Name

func (z *Zone) Name() string

func (*Zone) PubKey

func (z *Zone) PubKey() ed25519.PublicKey

func (*Zone) SetEnforcedEntries

func (z *Zone) SetEnforcedEntries(set RRSet)

func (*Zone) SetRR

func (z *Zone) SetRR(rrtype string, name string, rrset RRSet) error

func (*Zone) Sign

func (z *Zone) Sign() (zones []*Zone, err error)

func (*Zone) SignRRSet

func (z *Zone) SignRRSet(rrset RRSet) (*dns.RRSIG, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL