config

package
v0.0.0-...-c0ee157 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHash         = errors.New("the encoded hash is not in the correct format")
	ErrIncompatibleVersion = errors.New("incompatible version of argon2")
)
View Source
var Config = viper.New()

Functions

func AddInterfaceConfig

func AddInterfaceConfig(ifName string) error

func AddRouteConfig

func AddRouteConfig(ifName string, routeCidr string) error

func CheckAuth

func CheckAuth(username, password string) bool

func DeleteInterfaceConfig

func DeleteInterfaceConfig(ifName string) error

func DeleteRouteConfig

func DeleteRouteConfig(ifName string, routeCidr string) error

func GetInterfaceConfigState

func GetInterfaceConfigState() (map[string]InterfaceInfo, error)

func InitConfig

func InitConfig(configFile string)

Types

type InterfaceConfig

type InterfaceConfig struct {
	Routes []string
}

interface.name config

func GetInterfaceConfig

func GetInterfaceConfig(ifName string) *InterfaceConfig

type InterfaceInfo

type InterfaceInfo struct {
	Routes []InterfaceRoute
	Active bool
}

func (*InterfaceInfo) GetRouteString

func (i *InterfaceInfo) GetRouteString() string

func (*InterfaceInfo) GetRoutes

func (i *InterfaceInfo) GetRoutes() (routes []string)

func (*InterfaceInfo) GetStateString

func (i *InterfaceInfo) GetStateString() string

func (*InterfaceInfo) IsRouteActive

func (i *InterfaceInfo) IsRouteActive(route string) bool

type InterfaceRoute

type InterfaceRoute struct {
	Destination string
	Active      bool
}

Jump to

Keyboard shortcuts

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