conf

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: MIT Imports: 3 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
	Version   string
	Level     uint
	Component string
	Debug     bool
	Env       Env
}

App 应用基本配置

func (*App) IsProduction

func (a *App) IsProduction() bool

type Config

type Config struct {
	App    *App
	Root   *RootUser
	Server *struct {
		GRPC *server
	}
	Database *Database
	Log      *Log
	Jaeger   *Jaeger
	DBTables *DBTables

	OutFileName string
}

Config 全局Config

func NewConfig

func NewConfig(filepath string) (*Config, error)

NewConfig config 初始化

type DBTables

type DBTables struct {
	Tables map[string][]string
}

type Database

type Database struct {
	Host     string
	User     string
	Password string
	Name     string
}

Database 数据库配置

type Env

type Env string
const (
	EnvProduction Env = "prod"
	EnvTest       Env = "test"
	EnvDev        Env = "dev"
	EnvLocal      Env = "local"
)

type Jaeger

type Jaeger struct {
	Endpoint string
}

type Log

type Log struct {
	Type  string
	Level string
}

Log 日志配置

type RootUser

type RootUser struct {
	Account  string
	Email    string
	Password string
}

Jump to

Keyboard shortcuts

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