Versions in this module Expand all Collapse all v0 v0.1.0 Nov 16, 2026 Changes in this version + const BusinessKeyMax + const BusinessRecordSchemaSHA256 + const DNSReasonMalformed + const DNSReasonNetwork + const DNSReasonRefused + const DNSReasonServfail + const DNSReasonTimeout + const DNSTimeLimit + const FetchTimeLimit + const ISO3166SHA256 + const MaxDetails + const MaxRecordBytes + const MaxRecordDepth + const MaxRecordKeys + const SchemaID + const SpecRevision + const UserAgent + const Version + const WellKnownSchemaSHA256 + var BusinessRecordSchema []byte + var ErrNotIJSON = errors.New("abiz: value is not I-JSON") + var ISO3166 []byte + var WellKnownSchema []byte + func Canonicalize(value any) ([]byte, error) + func CanonicalizeJSON(text []byte) ([]byte, error) + func CheckRecord(recordText []byte, domain string, assertion *Assertion) (ErrorCode, []Problem, map[string]any) + func FormatNumber(f float64) string + func IdentityParts(value string) string + func IsAssertion(value string) bool + func IsAssignedCountry(code string) bool + func IsNonPublicHost(host string) bool + func IsPublicAddr(addr netip.Addr) bool + func IsPublicAddress(address string) bool + func IsPublicKey(value string) bool + func IsSafeHTTPSURL(value string) bool + func IsSafeHost(raw string) bool + func ParseAssertion(value string) (*Assertion, *AssertionError) + func ParseJSON(text []byte) (any, error) + func ParseRecordJSON(text []byte) (any, ErrorCode, []Problem) + func RecordURL(h string) string + func SameBusinessKey(a, b string) bool + func SignRecord(record map[string]any, privateKey ed25519.PrivateKey) (map[string]any, error) + func SigningInput(record map[string]any) ([]byte, error) + func VerifySignature(record map[string]any, p string) (ErrorCode, *Problem) + func WellKnownURL(domain string) string + type AddressResolver interface + LookupNetIP func(ctx context.Context, network, host string) ([]netip.Addr, error) + type Assertion struct + H string + HasK bool + K string + P string + Unknown map[string]string + type AssertionError struct + Code ErrorCode + Message string + func (e *AssertionError) Error() string + type BusinessKey struct + Canonical string + Country string + Number string + Subdivision string + func ParseBusinessKey(value string) (BusinessKey, error) + type DNSResolver struct + Servers []string + Timeout time.Duration + func NewDNSResolver() *DNSResolver + func NewDNSResolverWithServers(servers ...string) *DNSResolver + func (r *DNSResolver) LookupTXT(ctx context.Context, name string) TXTResult + type Discovery struct + DNSTTL *int + DNSValue string + DNSValues []string + Method string + Owner string + RecordURL string + WellKnown string + WellKnownURL string + type ErrorCode string + const CodeBadPointer + const CodeBothInputs + const CodeBusinessKeyMismatch + const CodeDNSFailure + const CodeDNSTimeout + const CodeDomainNotClaimed + const CodeDuplicateTag + const CodeFetchFailed + const CodeIdentityHostMismatch + const CodeInvalidDomain + const CodeInvalidKey + const CodeInvalidWebsite + const CodeMissingH + const CodeMissingInput + const CodeMissingTXT + const CodeMultipleTXT + const CodeNonPublicDomain + const CodeNotJSON + const CodeOriginUnavailable + const CodePublicKeyMismatch + const CodeRecordTooLarge + const CodeSchemaInvalid + const CodeSignatureInvalid + const CodeUnsafeHost + const CodeUpstreamTimeout + func DomainFromWebsite(raw string) (string, ErrorCode, string) + func NormaliseDomain(raw string) (string, ErrorCode, string) + func NormaliseInput(in Input) (domain string, code ErrorCode, message string) + func (c ErrorCode) Message() string + func (c ErrorCode) Retryable() bool + func (c ErrorCode) Status() Status + type FetchKind int + const FetchBlocked + const FetchDNSError + const FetchNetwork + const FetchNoAddress + const FetchResponse + const FetchTimeout + type FetchResult struct + Body []byte + ContentType string + Kind FetchKind + Message string + Status int + TooLarge bool + type Fetcher interface + Fetch func(ctx context.Context, url string) FetchResult + type GuardedFetcher struct + Resolver AddressResolver + func NewGuardedFetcher() *GuardedFetcher + func (f *GuardedFetcher) Fetch(ctx context.Context, rawURL string) FetchResult + type Input struct + Domain string + Website string + type Option func(*Resolver) + func WithFetcher(f Fetcher) Option + func WithTXTResolver(r TXTResolver) Option + type Problem struct + Message string + Path string + func ValidateSchema(record any) []Problem + type Resolver struct + func NewResolver(opts ...Option) *Resolver + func (r *Resolver) Resolve(ctx context.Context, domain string) *Result + func (r *Resolver) ResolveInput(ctx context.Context, in Input) *Result + func (r *Resolver) ResolveWebsite(ctx context.Context, website string) *Result + type Result struct + Code ErrorCode + Details []Problem + Discovery *Discovery + Domain string + Message string + Record map[string]any + RecordJSON []byte + Retryable bool + Status Status + Truncated bool + Warnings []Warning + Website string + func Resolve(ctx context.Context, domain string) *Result + type Status string + const StatusConflict + const StatusInvalidInput + const StatusInvalidRecord + const StatusNotFound + const StatusResolved + const StatusUnavailable + type TXTKind int + const TXTAnswer + const TXTError + const TXTNXDomain + const TXTNoData + type TXTResolver interface + LookupTXT func(ctx context.Context, name string) TXTResult + type TXTResult struct + Kind TXTKind + Reason string + TTL int + Values []string + type Warning struct + Code string + Domain string + Message string