config

package
v0.0.0-...-b7dcdf6 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Server struct {
		HTTPListen string `config:"httplisten"`
	} `config:"server"`
	Log        Log `config:"log"`
	DB         DB  `config:"db"`
	Repository struct {
		Type string `config:"type"`
	} `config:"repository"`
	// JWT signing key. required.
	JWTSigningKey string `yaml:"jwt_signing_key" config:"JWT_SIGNING_KEY,secret"`
	// JWT expiration in hours. Defaults to 72 hours (3 days)
	JWTExpiration int `yaml:"jwt_expiration" config:"JWT_EXPIRATION"`
}

Configuration is the struct for app configuration

func Get

func Get() (*Configuration, error)

Get func return the app config

type DB

type DB struct {
	Dialect string `config:"dialect"`
	DSN     string `config:"dsn"`
}

DB is config for a DB connection

type Log

type Log struct {
	Encoding      string
	OutputPaths   []string `config:"outputPaths"`
	Level         string
	InitialFields map[string]interface{} `config:"initialFields"`
}

Log is config for a logger

Jump to

Keyboard shortcuts

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