shared

package
v0.0.0-...-82a5891 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Verbose            bool
	Domain             string
	SOAFqdn            string
	HostExpirationDays int
	ListenFrontend     string
	ListenBackend      string
	RedisHost          string
}

func (*Config) Initialize

func (c *Config) Initialize()

func (*Config) Validate

func (c *Config) Validate()

type Host

type Host struct {
	Hostname string `redis:"-"`
	Ip       string `redis:"ip"`
	Token    string `redis:"token"`
}

func (*Host) GenerateAndSetToken

func (h *Host) GenerateAndSetToken()

func (*Host) IsIPv4

func (h *Host) IsIPv4() bool

type HostBackend

type HostBackend interface {
	GetHost(string) (*Host, error)

	SetHost(*Host) error
}

type RedisBackend

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

func NewRedisBackend

func NewRedisBackend(config *Config) *RedisBackend

func (*RedisBackend) Close

func (r *RedisBackend) Close()

func (*RedisBackend) GetHost

func (r *RedisBackend) GetHost(name string) (*Host, error)

func (*RedisBackend) SetHost

func (r *RedisBackend) SetHost(host *Host) error

Jump to

Keyboard shortcuts

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