config

package
v0.0.0-...-faa3d42 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	MinPasswordStrength int `yaml:"min_password_strength,omitempty"`
}

Application represents application specific configuration

type Configuration

type Configuration struct {
	Server  Server      `yaml:"server,omitempty"`
	DB      Database    `yaml:"database,omitempty"`
	JWT     JWT         `yaml:"jwt,omitempty"`
	App     Application `yaml:"application,omitempty"`
	OpenAPI OpenAPI     `yaml:"openapi,omitempty"`
}

Configuration holds application configuration data

func Load

func Load(path string) (*Configuration, error)

Load loads the configuration file from the given path

type Database

type Database struct {
	PSN            string `yaml:"psn,omitempty"`
	LogQueries     bool   `yaml:"log_queries,omitempty"`
	TimeoutSeconds int    `yaml:"timeout_seconds,omitempty"`
}

Database holds data necessery for database configuration

type JWT

type JWT struct {
	Secret    string `yaml:"secret,omitempty"`
	Duration  int    `yaml:"duration_minutes,omitempty"`
	Algorithm string `yaml:"signing_algorithm,omitempty"`
}

JWT holds data necessery for JWT configuration

type OpenAPI

type OpenAPI struct {
	Username string `yaml:"username,omitempty"`
	Password string `yaml:"password,omitempty"`
}

OpenAPI holds username password for viewing api docs

type Server

type Server struct {
	Port                string `yaml:"port,omitempty"`
	ReadTimeoutSeconds  int    `yaml:"read_timeout_seconds,omitempty"`
	WriteTimeoutSeconds int    `yaml:"write_timeout_seconds,omitempty"`
}

Server holds data necessery for server configuration

Jump to

Keyboard shortcuts

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