service

package
v0.0.0-...-00661cb Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var C config

Functions

func DNSUpdateEntry

func DNSUpdateEntry(domain string, hostname string, ip4 net.IP, ip6 net.IP) error

func HashPassword

func HashPassword(pw []byte) (string, error)

func LoadConfig

func LoadConfig()

func NFTUpdateSetsCmd

func NFTUpdateSetsCmd(tableName string, set4name string, ip4 net.IP, set6name string, ip6 net.IP) error

func SetConfigDefaults

func SetConfigDefaults()

Types

type NFTUpdate

type NFTUpdate struct {
	Tables map[string]*NFTUpdateTable
}

func NewNFTUpdate

func NewNFTUpdate() *NFTUpdate

func (*NFTUpdate) AddIP

func (nu *NFTUpdate) AddIP(TableName string, SetName string, IP net.IP) error

func (*NFTUpdate) FindOrAddTable

func (nu *NFTUpdate) FindOrAddTable(TableName string) *NFTUpdateTable

func (*NFTUpdate) PrettyPrint

func (obj *NFTUpdate) PrettyPrint() string

func (*NFTUpdate) Process

func (upd *NFTUpdate) Process() error

type NFTUpdateSet

type NFTUpdateSet struct {
	SetName string
	IP6Set  bool
	IPs     []net.IP
	// contains filtered or unexported fields
}

type NFTUpdateTable

type NFTUpdateTable struct {
	TableName string
	Sets      map[string]*NFTUpdateSet
	// contains filtered or unexported fields
}

func (*NFTUpdateTable) FindOrAddSet

func (nut *NFTUpdateTable) FindOrAddSet(SetName string, IP6 bool) (*NFTUpdateSet, error)

type UnauthorizedError

type UnauthorizedError string

func (UnauthorizedError) Error

func (uae UnauthorizedError) Error() string

type UpdateRequest

type UpdateRequest struct {
	IPv4     net.IP
	IPv6     net.IP
	UserName string
	Password string `json:"-"`
	IPv6Net  *net.IPNet
	Config   *UserConfig `json:"-"`
}

func LoadStateFile

func LoadStateFile(uc *UserConfig) (*UpdateRequest, error)

func (*UpdateRequest) MergeOldStateFile

func (ur *UpdateRequest) MergeOldStateFile()

func (*UpdateRequest) PrettyPrint

func (ur *UpdateRequest) PrettyPrint() string

func (*UpdateRequest) Process

func (ur *UpdateRequest) Process() error

func (*UpdateRequest) SaveStateFile

func (ur *UpdateRequest) SaveStateFile() error

func (*UpdateRequest) String

func (ur *UpdateRequest) String() string

type UserConfig

type UserConfig struct {
	UserName string
	PassWord string
	Domain   string
	Router   UserConfigRouter
	Others   []UserConfigOther
	// contains filtered or unexported fields
}

func LoadConfigFile

func LoadConfigFile(configFile string) (*UserConfig, error)

func LoadConfigForUser

func LoadConfigForUser(username string, password string) (*UserConfig, error)

func (*UserConfig) Authenticate

func (uc *UserConfig) Authenticate(pwToCheck string) error

func (*UserConfig) GetStateFileName

func (uc *UserConfig) GetStateFileName() string

func (*UserConfig) PrettyPrint

func (uc *UserConfig) PrettyPrint() string

func (*UserConfig) Validate

func (uc *UserConfig) Validate() error

type UserConfigNFT

type UserConfigNFT struct {
	Table string
	Set4  string
	Set6  string
}

func (*UserConfigNFT) ValidateSetNames

func (ucn *UserConfigNFT) ValidateSetNames() error

type UserConfigOther

type UserConfigOther struct {
	Hostname   string
	V6IID      string
	RegisterV4 bool
	NFT        UserConfigNFT
}

func (*UserConfigOther) ConvertIIDToAddress

func (uco *UserConfigOther) ConvertIIDToAddress(localNet *net.IPNet) net.IP

type UserConfigRouter

type UserConfigRouter struct {
	Hostname string
	NFT      UserConfigNFT
}

Jump to

Keyboard shortcuts

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