conf

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidUrl

func IsValidUrl(input string) bool

Types

type ClientConf

type ClientConf struct {
	Host            string `json:"host"`
	KeyPairPath     string `json:"keypair_path"`
	MetricsListener string `json:"metrics_listen",omitempty`
	Once            bool   // this is not parsed via json, it's an cli flag
	MqttConfig
	*InterfaceConfig
}

func ReadClientConfig

func ReadClientConfig(path string) (*ClientConf, error)

func (*ClientConf) Print

func (conf *ClientConf) Print()

func (*ClientConf) Validate

func (conf *ClientConf) Validate() error

type InterfaceConfig

type InterfaceConfig struct {
	NetworkInterface string `json:"interface"`
}

func (*InterfaceConfig) Print

func (conf *InterfaceConfig) Print()

func (*InterfaceConfig) Validate

func (conf *InterfaceConfig) Validate() error

type MqttConfig

type MqttConfig struct {
	Brokers  []string `json:"brokers"`
	ClientId string   `json:"client_id"`
}

func (*MqttConfig) Print

func (conf *MqttConfig) Print()

func (*MqttConfig) Validate

func (conf *MqttConfig) Validate() error

type ServerConf

type ServerConf struct {
	KnownHosts      map[string]string `json:"known_hosts"`
	HostedZoneId    string            `json:"hosted_zone_id"`
	MetricsListener string            `json:"metrics_listen",omitempty`
	MqttConfig
	VaultConfig
}

func ReadServerConfig

func ReadServerConfig(path string) (*ServerConf, error)

func (*ServerConf) DecodePublicKeys

func (conf *ServerConf) DecodePublicKeys() map[string]verification.VerificationKey

func (*ServerConf) Print

func (conf *ServerConf) Print()

func (*ServerConf) Validate

func (conf *ServerConf) Validate() error

type VaultConfig

type VaultConfig struct {
	RoleName      string `json:"vault_role_name,omitempty"`
	VaultAddr     string `json:"vault_addr,omitempty"`
	AppRoleId     string `json:"vault_app_role_id,omitempty"`
	AppRoleSecret string `json:"vault_app_role_secret,omitempty"`
	VaultToken    string `json:"vault_token,omitempty"`
}

func GetDefaultVaultConfig

func GetDefaultVaultConfig() VaultConfig

func (*VaultConfig) HasAppRoleLoginInfo

func (c *VaultConfig) HasAppRoleLoginInfo() bool

func (*VaultConfig) HasTokenInfo

func (c *VaultConfig) HasTokenInfo() bool

func (*VaultConfig) Print

func (c *VaultConfig) Print()

func (*VaultConfig) Verify

func (c *VaultConfig) Verify() error

func (*VaultConfig) WithAppRole

func (c *VaultConfig) WithAppRole(appRoleId, appRoleSecret string) *VaultConfig

func (*VaultConfig) WithRoleName

func (c *VaultConfig) WithRoleName(roleName string) *VaultConfig

func (*VaultConfig) WithVaultToken

func (c *VaultConfig) WithVaultToken(vaultToken string) *VaultConfig

Jump to

Keyboard shortcuts

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