Help us shape the future of Go! Take the 2026 Go Developer Survey

server

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDecoderOptions

func ConfigDecoderOptions(config *mapstructure.DecoderConfig)

ConfigDecoderOptions enables necessary mapstructure decode hook functions

Types

type CleanupConfig added in v1.1.0

type CleanupConfig struct {
	Interval time.Duration
	MaxAge   time.Duration `mapstructure:"max_age"`
}

type Config

type Config struct {
	LogLevel log.Level `mapstructure:"log_level"`

	PostgreSQL struct {
		Host         string
		User         string
		Password     string
		PasswordFile string `mapstructure:"password_file"`
		Database     string
		TimeZone     string
		DSNExtra     string `mapstructure:"dsn_extra"`

		SoftDelete bool `mapstructure:"soft_delete"`
	}

	Mail email.Config
	SMTP email.SMTPConfig

	HTTP struct {
		ListenAddress string `mapstructure:"listen_address"`
		CORS          struct {
			AllowedOrigins []string `mapstructure:"allowed_origins"`
		}
	}

	JWT JWTConfig

	RootPassword     string `mapstructure:"root_password"`
	RootPasswordFile string `mapstructure:"root_password_file"`

	ReservedUsernames []string `mapstructure:"reserved_usernames"`
	Cleanup           CleanupConfig

	MA1SD MA1SDConfig
}

Config defines iamd's configuration

func (*Config) JWTKeyFunc

func (c *Config) JWTKeyFunc() jwt.Keyfunc

JWTKeyFunc returns a function that will return the JWT key (for use with `jwt` package)

func (*Config) ReadSecrets

func (c *Config) ReadSecrets() error

ReadSecrets loads values for secret config options from files

type JWTConfig added in v1.0.0

type JWTConfig struct {
	Key     []byte `mapstructure:"key"`
	KeyFile string `mapstructure:"key_file"`

	Issuer        string
	LoginValidity time.Duration `mapstructure:"login_validity"`
	EmailValidity time.Duration `mapstructure:"email_validity"`
}

type MA1SDConfig added in v1.0.0

type MA1SDConfig struct {
	HTTPAddress string `mapstructure:"http_address"`
	BaseURL     string `mapstructure:"base_url"`
	Domain      string
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents the iamd server

func NewServer

func NewServer(config Config) (*Server, error)

NewServer creates a new iamd server

func (*Server) CleanupUnverified added in v1.1.0

func (s *Server) CleanupUnverified() (int64, error)

func (*Server) Start

func (s *Server) Start() error

Start starts the iamd server

func (*Server) Stop

func (s *Server) Stop() error

Stop shuts down the iamd server

Jump to

Keyboard shortcuts

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