config

package
v0.0.0-...-42ff6b3 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name    string `env-required:"true" yaml:"name"    env:"APP_NAME"`
	Version string `env-required:"true" yaml:"version" env:"APP_VERSION"`
}

App -.

type Config

type Config struct {
	App  `yaml:"app"`
	HTTP `yaml:"http"`
	Log  `yaml:"logger"`
	// PG   `yaml:"postgres"`
	// RMQ  `yaml:"rabbitmq"`
	MDB `yaml:"mongodb"`
}

Config -.

func NewConfig

func NewConfig() (*Config, error)

NewConfig returns app config.

type HTTP

type HTTP struct {
	Port           string   `env-required:"true" yaml:"port" env:"HTTP_PORT"`
	AllowedOrigins []string `env-required:"true" yaml:"allowed-origins" env:"ALLOWED_ORIGINS"`
}

HTTP -.

type Log

type Log struct {
	Level string `env-required:"true" yaml:"log_level"   env:"LOG_LEVEL"`
}

Log -.

type MDB

type MDB struct {
	Username string `env-required:"true" yaml:"username" env:"MDB_USERNAME"`
	Password string `env-required:"true" yaml:"password" env:"MDB_PASSWORD"`
	Cluster  string `env-required:"true" yaml:"cluster"  env:"MDB_CLUSTER"`
	Database string `env-required:"true" yaml:"database" env:"MDB_DATABASE"`
}

// RMQ -.

RMQ struct {
	ServerExchange string `env-required:"true" yaml:"rpc_server_exchange" env:"RMQ_RPC_SERVER"`
	ClientExchange string `env-required:"true" yaml:"rpc_client_exchange" env:"RMQ_RPC_CLIENT"`
	// URL            string `env-required:"true"                            env:"RMQ_URL"`
}

Jump to

Keyboard shortcuts

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