Involved Source Filesdns.go Package pkarr implements the pkarr (https://pkarr.org) signed DNS packet
format used by iroh for endpoint discovery.
Wire format: <32-byte public key><64-byte signature><8-byte big-endian
microsecond timestamp><DNS wire packet>. The signature covers the BEP-0044
signable bytes derived from the timestamp and the encoded DNS packet. The DNS
packet must be at most 1000 bytes; the total signed packet is at most 1104.
It is a port of iroh-dns/src/pkarr.rs.
Package-Level Type Names (total 2)
/* sort by: | */
SignedPacket is a signed DNS packet in the pkarr format. It is immutable; all
accessors derive their result from the stored wire bytes. AllTxtRecords returns all TXT records as (name-relative-to-origin, value) pairs. Bytes returns the full serialized wire bytes. The result must not be mutated. EncodedPacket returns the encoded DNS packet bytes. MoreRecentThan reports whether p is more recent than other, breaking ties on
equal timestamps by comparing the encoded DNS packets. PublicKey returns the signer's public key. RelayPayload returns the relay payload: everything after the public key. Signature returns the packet signature. Timestamp returns the packet timestamp. TxtRecords returns the TXT string values under the given DNS name (normalized
relative to the signer's z-base-32 public key).
*SignedPacket : github.com/apache/arrow-go/v18/internal/hashing.ByteSlice
func FromBytes(b []byte) (*SignedPacket, error)
func FromBytesUnchecked(b []byte) (*SignedPacket, error)
func FromRelayPayload(pub key.PublicKey, payload []byte) (*SignedPacket, error)
func FromTxtStrings(sk key.SecretKey, name string, values []string, ttl uint32) (*SignedPacket, error)
func (*SignedPacket).MoreRecentThan(other *SignedPacket) bool
Timestamp is a pkarr timestamp in microseconds since the UNIX epoch. Micros returns the raw microseconds value.
func Now() Timestamp
func TimestampFromMicros(micros uint64) Timestamp
func (*SignedPacket).Timestamp() Timestamp
Package-Level Functions (total 6)
FromBytes parses and verifies a signed packet from its wire representation.
FromBytesUnchecked parses a signed packet without verifying its signature. It
still validates the minimum length and that the DNS packet parses.
FromRelayPayload reconstructs a signed packet from a public key and a relay
payload (signature + timestamp + DNS packet, i.e. everything after the key).
FromTxtStrings creates a signed packet containing one TXT record per value,
all under the single DNS name relative to the signer's z-base-32 public key
(the common case, e.g. name "_iroh"). ttl is the record TTL in seconds.
Now returns a strictly monotonic timestamp: greater than any previous call,
even if the system clock moves backward.
TimestampFromMicros creates a timestamp from a raw microseconds value.
Package-Level Variables (total 6)
Errors returned by this package.
Errors returned by this package.
Errors returned by this package.
Errors returned by this package.
Errors returned by this package.
Errors returned by this package.
Package-Level Constants (only one)
MaxBytes is the maximum total size of a serialized signed packet.
The pages are generated with Goldsv0.8.4. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.