conf

package
v0.0.0-...-fa57f66 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlagsForAppConfig

func FlagsForAppConfig(prefix string, config *AppConfig) *pflag.FlagSet

func FlagsForFilesystemConfig

func FlagsForFilesystemConfig(prefix string, config *FilesystemConfig) *pflag.FlagSet

func ReadConfig

func ReadConfig(
	cmd *cobra.Command,
	configFile *string,
	cliLogConfig *log.Config,
	config *Config,
) (context.Context, error)

Types

type AppConfig

type AppConfig struct {
	Log log.ConfigSet `json:"log" yaml:"log"`

	AuthService     AuthServiceConfig     `json:"auth_service" yaml:"auth_service"`
	KeychainService KeychainServiceConfig `json:"keychain_service" yaml:"keychain_service"`
}

type AuthServiceConfig

type AuthServiceConfig struct {
	Name   string      `json:"name" yaml:"name"`
	Config interface{} `json:"config" yaml:"config"`
}

func (*AuthServiceConfig) UnmarshalJSON

func (c *AuthServiceConfig) UnmarshalJSON(data []byte) error

func (*AuthServiceConfig) UnmarshalYAML

func (c *AuthServiceConfig) UnmarshalYAML(value *yaml.Node) error

type Config

type Config struct {
	App AppConfig `json:"app" yaml:"app"`

	FS FilesystemConfig `json:"fs" yaml:"fs"`
}

type FilesystemConfig

type FilesystemConfig struct {
	Mountpoint string `json:"mountpoint" yaml:"mountpoint"`
	Debug      bool   `json:"debug" yaml:"debug"`

	DefaultPermitDuration  time.Duration `json:"default_permit_duration" yaml:"default_permit_duration"`
	DefaultPenaltyDuration time.Duration `json:"default_penalty_duration" yaml:"default_penalty_duration"`

	LoginInterface string `json:"login_interface" yaml:"login_interface"`

	Spec []struct {
		PM     PasswordManagerConfig `json:"pm" yaml:"pm"`
		Mounts []MountConfig         `json:"mounts" yaml:"mounts"`
	} `json:"spec" yaml:"spec"`
}

type KeychainServiceConfig

type KeychainServiceConfig struct {
	Name   string      `json:"name" yaml:"name"`
	Config interface{} `json:"config" yaml:"config"`
}

func (*KeychainServiceConfig) UnmarshalJSON

func (c *KeychainServiceConfig) UnmarshalJSON(data []byte) error

func (*KeychainServiceConfig) UnmarshalYAML

func (c *KeychainServiceConfig) UnmarshalYAML(value *yaml.Node) error

type MountConfig

type MountConfig struct {
	From string `json:"from" yaml:"from"`
	To   string `json:"to" yaml:"to"`

	PenaltyDuration *time.Duration `json:"penalty_duration" yaml:"penalty_duration"`
	PermitDuration  *time.Duration `json:"permit_duration" yaml:"permit_duration"`
}

type PasswordManagerConfig

type PasswordManagerConfig struct {
	Driver string `json:"driver" yaml:"driver"`

	Name   string      `json:"name" yaml:"name"`
	Config interface{} `json:"config" yaml:"config"`
}

func (*PasswordManagerConfig) UnmarshalJSON

func (c *PasswordManagerConfig) UnmarshalJSON(data []byte) error

func (*PasswordManagerConfig) UnmarshalYAML

func (c *PasswordManagerConfig) UnmarshalYAML(value *yaml.Node) error

Jump to

Keyboard shortcuts

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