domain

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound             = errors.New("domain not found")
	ErrOwnershipNotVerified = errors.New("domain ownership not verified")
)

Functions

This section is empty.

Types

type CachingDomainRepo

type CachingDomainRepo interface {
	DomainRepo

	// SetWithTTL stores a domain with a specific TTL override.
	SetWithTTL(ctx context.Context, domain *Domain, ttl time.Duration) error

	// Clear removes all entries from the cache.
	Clear(ctx context.Context) error
}

type DNSRecord

type DNSRecord struct {
	Type  string `json:"type" yaml:"type"`
	Name  string `json:"name" yaml:"name"`
	Value string `json:"value" yaml:"value"`
}

type Domain

type Domain struct {
	Hostname string `json:"hostname" yaml:"hostname"`
	// TenantID identifies the tenant/customer this domain belongs to.
	// This value is opaque to the system, users can use any string format they prefer.
	TenantID string `json:"tenant_id,omitempty" yaml:"tenant_id,omitempty"`

	OwnershipVerified bool `json:"ownership_verified" yaml:"ownership_verified"`

	// VerificationToken is a stable UUID used as the DNS TXT record value for ownership verification.
	// Generated once on first upsert and never rotated unless explicitly cleared.
	VerificationToken string `json:"verification_token,omitempty" yaml:"verification_token,omitempty"`
}

func (*Domain) Clone

func (d *Domain) Clone() *Domain

type DomainPatch

type DomainPatch struct {
	TenantID          *string
	OwnershipVerified *bool
	VerificationToken *string
}

type DomainRepo

type DomainRepo interface {
	UniqueID() string
	Get(ctx context.Context, hostname string) (*StoredDomain, error)
	Set(ctx context.Context, domain *Domain) error
	Patch(ctx context.Context, hostname string, patch DomainPatch) error
	Delete(ctx context.Context, hostname string) error

	Destruct() error
}

type ReadOnlyDomainRepo

type ReadOnlyDomainRepo interface {
	DomainRepo
	ReadOnly() bool
}

type StoredDomain

type StoredDomain struct {
	Domain   *Domain       `json:"domain" yaml:"domain"`
	TTL      time.Duration `json:"ttl,omitempty" yaml:"ttl,omitempty"`
	CachedAt time.Time     `json:"cached_at,omitempty" yaml:"cached_at,omitempty"`
	Source   string        `json:"source,omitempty" yaml:"source,omitempty"`
}

Jump to

Keyboard shortcuts

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