config

package
v0.0.0-...-74a3497 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupConfig

func SetupConfig(c *Config, file string) error

SetupConfig reads the configuration from the specified file

Types

type Config

type Config struct {
	Log   Log   `mapstructure:"log"`
	Knock Knock `mapstructure:"knock"`
	Door  Door  `mapstructure:"door"`
}

Config is the entrypoint for all configuration items

func NewDefaultConfig

func NewDefaultConfig() Config

NewDefaultConfig create a default configuration structure with the same values as the default configuration in config.yaml

type Door

type Door struct {
	Type     string        `mapstructure:"type"`
	RouterOS *DoorRouterOS `mapstructure:"routeros"`
}

Door is knockdoor door configuration

type DoorRouterOS

type DoorRouterOS struct {
	Endpoint        string `mapstructure:"endpoint"`
	Username        string `mapstructure:"username"`
	Password        string `mapstructure:"password"`
	AddressListName string `mapstructure:"addressListName"`
}

DoorRouterOS is knockdoor door configuration for RouterOS

type Knock

type Knock struct {
	Mode         string     `mapstructure:"mode"`
	Static       *[]uint16  `mapstructure:"static"`
	TOTP         *KnockTOTP `mapstructure:"totp"`
	SkipLoopback bool       `mapstructure:"skipLoopback"`
}

Knock is knockdoor knock configuration

type KnockTOTP

type KnockTOTP struct {
	Secret string `mapstructure:"secret"`
	Prefix string `mapstructure:"prefix"`
}

KnockTOTP is knockdoor core configuration for TOTP mode

type Log

type Log struct {
	Level string `mapstructure:"level"`
	Path  string `mapstructure:"path"`
}

Log configuration

Jump to

Keyboard shortcuts

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