config

package
v0.0.0-...-8b7ce6b Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2021 License: AGPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicConfig

type BasicConfig struct {
	Config
}

func (BasicConfig) GetConfig

func (e BasicConfig) GetConfig() *Config

type Config

type Config struct {
	ListenPort uint16 `yaml:"listenPort"`
	// How long LoginTokens should be valid / stored
	LoginTokenLifeTimeSeconds uint64 `yaml:"loginTokenLifeTimeSeconds"`
	// How many LoginTokens can be generated before rejecting new
	// requests
	MaxLoginTokenCount uint16 `yaml:"maxLoginTokenCount"`
	// See SMTPConfig
	SMTP SMTPConfig `yaml:"smtp"`
	// Can either be `alpha` or `numeric`
	TokenFormat string `yaml:"tokenFormat"`
	TokenLength int    `yaml:"tokenLength"`
	// this will show up in emails
	ServiceName string `yaml:"serviceName"`
	// where the database is stored
	StatePath string `yaml:"statePath"`
	// where the signing keys are stored
	KeyPath string `yaml:"keyPath"`
	// make this short lived, e.g. 1 hour
	AccessTokenLifetimeSeconds uint64 `yaml:"accessTokenLifetimeSeconds"`
	// make this long lived, e.g. 3 days
	RefreshTokenLifetimeSeconds uint64 `yaml:"refreshTokenLifetimeSeconds"`
}

func ReadConfigFromFile

func ReadConfigFromFile(path string) (*Config, error)

func (Config) Validate

func (c Config) Validate() error

type Configurable

type Configurable interface {
	GetConfig() *Config
}

type SMTPConfig

type SMTPConfig struct {
	FromAddr string `yaml:"fromAddr"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	Host     string `yaml:"host"`
	Port     uint16 `yaml:"port"`
}

Jump to

Keyboard shortcuts

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