server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TTL = 300 * time.Second
)

Variables

This section is empty.

Functions

func ParseConfig

func ParseConfig(config map[interface{}]interface{}) (commonConfig *CommonConfig, awsConfig *AwsConfig, gcpConfig *GcpConfig, err error)

domain, nameserver, port, rname string, private bool,

Types

type AwsConfig

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

type CloudVendor

type CloudVendor string
const (
	CacheName             = "CLOUD-NAME-SERVER"
	UNKNOWN   CloudVendor = "UNKNOWN"
	AWS       CloudVendor = "AWS"
	GCP       CloudVendor = "GCP"
)

type CommonConfig

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

type GcpConfig

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

type LookupTable

type LookupTable map[string][]*Record

type Record

type Record struct {
	Vendor       CloudVendor
	ZoneOrRegion string
	PublicIP     net.IP
	PrivateIP    net.IP
	ExpiredAt    time.Time
}

func (*Record) TTL

func (r *Record) TTL() time.Duration

type Server

type Server interface {
	Start()
}

func NewServer

func NewServer(yamlPath string) (Server, error)

type Store

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

func NewStore

func NewStore(awsconf *AwsConfig, gcpconf *GcpConfig) (*Store, error)

func (*Store) Lookup

func (s *Store) Lookup(key string) ([]*Record, error)

Jump to

Keyboard shortcuts

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