config

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

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

Go to latest
Published: May 28, 2019 License: MIT Imports: 4 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 {
	MinPasswordStr int    `yaml:"min_password_strength,omitempty"`
	SwaggerUIPath  string `yaml:"swagger_ui_path,omitempty"`
}

Application holds application configuration details

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"`
}

Configuration holds data necessery for configuring application

func Load

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

Load returns Configuration struct

func LoadConfig

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

type Database

type Database struct {
	DBName       string `yaml:"dbName,omitempty" json:"dbname,omitempty"`
	PSN          string `yaml:"psn,omitempty" json:"psn,omitempty"`
	LogQueries   bool   `yaml:"log_queries,omitempty"`
	PSNBase      string `yaml:"psnBase,omitempty" json:"psnBase,omitempty"`
	Log          bool
	CreateSchema bool
	Timeout      int
	MaxRetries   int `yaml:"maxRetries,omitempty" json:"maxRetries,omitempty"`
}

Database holds data necessery for database configuration

type ErrorDict

type ErrorDict struct {
	ErrorList []ErrorMessage `yaml:"error_list,omitempty" json:"errorList,omitempty"`
}

func LoadErrorList

func LoadErrorList() (*ErrorDict, error)

type ErrorMessage

type ErrorMessage struct {
	Type string `yaml:"type,omitempty" json:"type,omitempty"`
	Text string `yaml:"text,omitempty" json:"text,omitempty"`
}

type JWT

type JWT struct {
	Secret           string `yaml:"secret,omitempty"`
	Duration         int    `yaml:"duration_minutes,omitempty"`
	RefreshDuration  int    `yaml:"refresh_duration_minutes,omitempty"`
	MaxRefresh       int    `yaml:"max_refresh_minutes,omitempty"`
	SigningAlgorithm string `yaml:"signing_algorithm,omitempty"`
}

JWT holds data necessery for JWT configuration

type Server

type Server struct {
	Host          string `yaml:"host,omitempty"`
	Port          string `yaml:"port,omitempty"`
	Debug         bool   `yaml:"debug,omitempty"`
	ReadTimeout   int    `yaml:"read_timeout_seconds,omitempty"`
	WriteTimeout  int    `yaml:"write_timeout_seconds,omitempty"`
	SwaggerUIPath string `yaml:"swagger_ui_path,omitempty"`
	SwaggerJSON   string `yaml:"swagger_json,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