config

package
v0.0.0-...-92f7cd3 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 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"`
		GRPCListen              string `config:"grpclisten"`
		HTTPForPrometheuslisten string `yaml:"http_for_prometheus_listen" config:"http_for_prometheus_listen"`
	} `config:"server"`
	Log        Log   `config:"log"`
	DB         DB    `config:"db"`
	Queue      Queue `config:"queue"`
	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 a 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 a config for a logger

type Queue

type Queue struct {
	RabbitMQ                 RabbitMQ
	RabbitMQUserNotification RabbitMQ
}

Queue is a config for a queue

type RabbitMQ

type RabbitMQ struct {
	ConsumerTag  string `yaml:"consumer_tag"`
	URI          string
	ExchangeName string `yaml:"exchange_name"`
	ExchangeType string `yaml:"exchange_type"`
	Queue        string
	BindingKey   string `yaml:"binding_key"`
}

RabbitMQ is a config for a connection to a RabbitMQ host

Jump to

Keyboard shortcuts

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