config

package
v0.0.0-...-4db5c07 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config содержит конфигурацию сервера.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App информация о приложении.

type Config

type Config struct {
	App   `yaml:"app"`
	PG    `yaml:"postgres"`
	GRPC  `yaml:"grpc"`
	Token `yaml:"token"`
}

Config основная конфигурация.

func New

func New() (*Config, error)

New создаёт объект Config.

type GRPC

type GRPC struct {
	Port string `yaml:"port" env:"GRPC_PORT"`
}

GRPC настройки gRPC.

type PG

type PG struct {
	MaxOpen      int    `yaml:"pool_max"      env:"PG_POOL_MAX"`
	ConnAttempts int    `yaml:"conn_attempts" env:"PG_CONN_ATTEMPTS"`
	URL          string `env-required:"true"  env:"PG_URL"`
}

PG подключение к БД Postgres.

type Token

type Token struct {
	Key            string        `env-required:"true"                        env:"TOKEN_KEY"`
	AccessDuration time.Duration `env-required:"true" yaml:"access_duration" env:"TOKEN_ACCESS_DURATION"`
}

Token настройки для формирования токена.

Jump to

Keyboard shortcuts

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