config

package
v0.0.0-...-cfca2e5 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 1 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 ` yaml:"name"    env:"APP_NAME"`
	Version string ` yaml:"version" env:"APP_VERSION"`
}

App -.

type Config

type Config struct {
	App    `yaml:"server-cmd"`
	HTTP   `yaml:"http"`
	Log    `yaml:"logger"`
	PG     `yaml:"postgres"`
	JWT    `yaml:"jwt"`
	WeChat `yaml:"we-chat"`
	File   `yaml:"file"`
}

Config -.

func NewConfig

func NewConfig() (*Config, error)

NewConfig returns server-cmd config.

type File

type File struct {
	RootDir string `yaml:"root_dir" env:"FILE_ROOT_DIR"`
}

File -.

type HTTP

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

HTTP -.

type JWT

type JWT struct {
	Secret string `yaml:"secret" env:"JWT_SECRET"`
	Expire int    `yaml:"expire" env:"JWT_EXPIRE"`
}

JWT -.

type Log

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

Log -.

type PG

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

PG -.

type WeChat

type WeChat struct {
	AppID     string `yaml:"app_id"     env:"WECHAT_APP_ID"`
	AppSecret string `yaml:"app_secret" env:"WECHAT_APP_SECRET"`
	Token     string `yaml:"token"      env:"WECHAT_TOKEN"`
	Encoding  string `yaml:"encoding"   env:"WECHAT_ENCODING"`
}

WeChat -.

Jump to

Keyboard shortcuts

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