config

package
v0.0.0-...-6f474b3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorInvalidRequest = "INVALID_REQUEST"
	ErrorInvalidToken   = "INVALID_TOKEN"
	ErrorInvalidUser    = "INVALID_USER"
	ErrorInvalidPass    = "INVALID_PASS"
	ErrorInvalidEmail   = "INVALID_EMAIL"
	ErrorInvalidPhone   = "INVALID_PHONE"
	ErrorSessionExpired = "SESSION_EXPIRED"
	ErrorInternalServer = "INTERNAL_SERVER"
	ErrorNotFound       = "NOT_FOUND"
	ErrorUnauthorized   = "UNAUTHORIZED"
	ErrorForbidden      = "FORBIDDEN"
	ErrorConflict       = "CONFLICT"
	ErrorBadRequest     = "BAD_REQUEST"
	ErrorDuplicateKey   = "DUPLICATE_KEY"
)
View Source
var (
	TokenExpireTime = 24 * time.Hour * 7 // 7 days
)

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"`
	JWT   `yaml:"jwt"`
	Redis `yaml:"redis"`
	Gmail `yaml:"gmail"`
	MinIO `yaml:"minio"`
}

Config -.

func NewConfig

func NewConfig() (*Config, error)

NewConfig returns app config.

type Gmail

type Gmail struct {
	Email     string `env-required:"true" yaml:"email" env:"EMAIL"`
	EmailPass string `env-required:"true" yaml:"email_pass" env:"EMAIL_PASS"`
	Host      string `env-required:"true" yaml:"host" env:"SMTP_HOST"`
	Port      string `env-required:"true" yaml:"port" env:"SMTP_PORT"`
}

type HTTP

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

HTTP -.

type JWT

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

JWT -.

type Log

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

Log -.

type MinIO

type MinIO struct {
	MinioUrl        string `env-required:"true" yaml:"miniourl" env:"MINIOURL"`
	MinioUser       string `env-required:"true" yaml:"miniouser" env:"MINIOUSER"`
	MinIOSecredKey  string `env-required:"true" yaml:"miniosecredkey" env:"MINIOSECREDKEY"`
	MinIOBucketName string `env-required:"true" yaml:"minibucketname" env:"MINIOBUCKETNAME"`
}

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 Redis

type Redis struct {
	RedisHost string `env-required:"true" yaml:"host" env:"REDIS_HOST"`
	RedisPort int    `env-required:"true" yaml:"port" env:"REDIS_PORT"`
}

Redis -.

Jump to

Keyboard shortcuts

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