config

package
v0.0.0-...-32d14c1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(filePath string) (Router, Database, Security, Authentication, error)

Load loads the configuration from a local .yml into the struct

Types

type Authentication

type Authentication struct {
	Algorithm        string `yaml:"algorithm"`
	ExpirationPeriod int    `yaml:"expiration_period"`
	MinKeyLength     int    `yaml:"minimum_key_length"`
	SecretKey        string `yaml:"secret_key"`
}

type Database

type Database struct {
	Type string `yaml:"type" required:"true"`
	Host string `yaml:"host" required:"true"`
	Port uint64 `yaml:"port,omitempty"`
	User string `yaml:"user" required:"true"`
	Pass string `yaml:"pass,omitempty"`
	Name string `yaml:"name,omitempty"`
}

type Router

type Router struct {
	Host                string `yaml:"host" default:"127.0.0.1"`
	Port                string `yaml:"port,omitempty" default:"8080"`
	ReadTimeoutSeconds  int    `yaml:"read_timeout_seconds"`
	WriteTimeoutSeconds int    `yaml:"write_timeout_seconds"`
}

type Security

type Security struct {
	Length        int  `yaml:"length" default:"8"`
	MixedCase     bool `yaml:"mixed_case" default:"false"`
	AlphaNum      bool `yaml:"alpha_num" default:"false"`
	SpecialChar   bool `yaml:"special_char" default:"false"`
	CheckPrevious bool `yaml:"check_previous" default:"true"`
}

Jump to

Keyboard shortcuts

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