config

package
v0.0.0-...-7d9ee97 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 8 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"`
	Swagger bool   `yaml:"swagger"`
}

App -.

type Config

type Config struct {
	App    `yaml:"app"`
	Log    `yaml:"log"`
	HTTP   `yaml:"http"`
	Consul `yaml:"consul"`
	PG     `yaml:"postgres"`
	RMQ    `yaml:"rabbitmq"`
	Extra  map[string]interface{} `yaml:"extra"`

	CClient *consul.Consul
	Pg      *postgres.Postgres
	Logger  *logger.Logger
}

Config -.

func NewConfig

func NewConfig() (*Config, error)

NewConfig returns app config.

type Consul

type Consul struct {
	CheckApi string   `yaml:"check_api"`
	Interval string   `yaml:"interval"`
	Timeout  string   `yaml:"timeout"`
	Tags     []string `yaml:"tags"`
}

Consul -.

type HTTP

type HTTP struct {
	Address string `env-required:"true" yaml:"address" env:"HTTP_ADDRESS"`
	Port    string `env-required:"true" yaml:"port" env:"HTTP_PORT"`
}

HTTP -.

type Log

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

Log -.

type PG

type PG struct {
	PoolMax int    `env-required:"true" yaml:"pool_max" env:"PG_POOL_MAX"`
	URL     string `env-required:"true"                 env:"PG_URL"`
}

PG -.

type RMQ

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

RMQ -.

Jump to

Keyboard shortcuts

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