config

package
v0.0.0-...-96c2995 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2018 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationConfig

type AuthenticationConfig struct {
	EXPLeeway  time.Duration `default:"180s"`
	NBFLeeway  time.Duration `default:"180s"`
	JWTExpires time.Duration `default:"15m"`
	JWTSubject string        `default:"auth"`
}

func LoadAuthenticationConfig

func LoadAuthenticationConfig() (*AuthenticationConfig, error)

type Config

type Config struct {
	Prod     bool `default:"false"`
	Server   *ServerConfig
	Database *DatabaseConfig
	Auth     *AuthenticationConfig
}

func Load

func Load() (*Config, error)

type DatabaseConfig

type DatabaseConfig struct {
	Host     string `default="localhost:5432"`
	DbName   string `default="portal"`
	User     string
	Password string
	URL      string
}

func LoadDatabaseConfig

func LoadDatabaseConfig() (*DatabaseConfig, error)

type ServerConfig

type ServerConfig struct {
	Host         string        `default:""`
	Port         int           `default:"3000"`
	WriteTimeout time.Duration `default:"15s"`
	ReadTimeout  time.Duration `default:"15s"`
	IdleTimeout  time.Duration `default:"60s"`
	ShutdownWait time.Duration `default:"15s"`
}

func LoadServerConfig

func LoadServerConfig() (*ServerConfig, error)

func (*ServerConfig) Addr

func (config *ServerConfig) Addr() string

Jump to

Keyboard shortcuts

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