config

package
v0.0.0-...-48b49ba Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() error

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"`
}

type Config

type Config struct {
	App    `yaml:"app"`
	HTTP   `yaml:"http"`
	Logger `yaml:"logger"`
	DB     `yaml:"db"`
	Redis  `yaml:"redis"`
	JWT    `yaml:"jwt"`
}
var Cfg *Config

type DB

type DB struct {
	URL string `env-required:"true" yaml:"url" env:"DB_URL"`
}

type HTTP

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

type JWT

type JWT struct {
	Secret   string `env-required:"true" yaml:"secret" env:"JWT_SECRET"`
	Duration int64  `env-required:"true" yaml:"duration" env:"JWT_DURATION"`
}

type Logger

type Logger struct {
	Level string `env-required:"true" yaml:"level" env:"LOG_LEVEL"`
}

type Redis

type Redis struct {
	URL string `env-required:"true" yaml:"url" env:"REDIS_URL"`
}

Jump to

Keyboard shortcuts

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