dns

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoAvailableIPs = errors.New("no available IPs")
	ErrSubdomainInUse = errors.New("subdomain already in-use")
)

Functions

This section is empty.

Types

type Client

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

Client is used to get IPs from the server over HTTP

func NewHTTPClient

func NewHTTPClient(addr string) (Client, error)

func (Client) GetIP

func (c Client) GetIP(ctx context.Context, subdomain string) (string, error)

func (Client) RegisterFallback added in v0.2.0

func (c Client) RegisterFallback(subdomain, address string) error

type Config

type Config struct {
	Address        string
	Domain         string
	FallbackRoutes FallbackRoutes
}

type FallbackRoutes

type FallbackRoutes map[string]string

FallbackRoutes maps a subdomain to an actual domain name that should be used when the local subdomain is not running on the server

type Manager

type Manager struct {
	Config
	// contains filtered or unexported fields
}

func New

func New(cfg Config) (Manager, error)

func (Manager) GetIP

func (m Manager) GetIP(ctx context.Context, subdomain string) (string, error)

GetIP allocates and returns an IP address. It will keep it open until the context is closed

func (Manager) RegisterFallback added in v0.2.0

func (m Manager) RegisterFallback(subdomain, address string)

RegisterFallback allows registering a fallback domain that will be used if a Goblin plugin is not running

func (Manager) RunDNS

func (m Manager) RunDNS(ctx context.Context) error

Jump to

Keyboard shortcuts

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