config

package
v0.0.0-...-71c9d12 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Conf = new(Config)

全局配置变量

Functions

This section is empty.

Types

type AppConf

type AppConf struct {
	Name          string `ini:"Name"`
	HttpPort      int    `ini:"HttpPort"`
	AppUrl        string `ini:"AppUrl"`
	BetaUrl       string `ini:"BetaUrl"`
	RunMode       string `ini:"RunMode"`
	RsaPrivateKey string `ini:"RsaPrivateKey"`
	RsaPublicKey  string `ini:"RsaPublicKey"`
	TokenLifeTime int64  `ini:"TokenLifeTime"`
	AppKey        string `ini:"AppKey"`
}

type Auth

type Auth struct {
	Oauth2 Oauth2Conf `ini:"Oauth2"`
	Ldap   LdapConf   `ini:"Ldap"`
}

type Config

type Config struct {
	App      AppConf  `ini:"App"`
	DataBase DataBase `ini:"DataBase"`
	Log      LogConf  `ini:"Log"`
	Auth     Auth     `ini:"Auth"`
}

func GetConfig

func GetConfig() Config

获取全局配置

type DataBase

type DataBase struct {
	Driver     string `ini:"Driver"`
	DBName     string `ini:"DBName"`
	Host       string `ini:"Host"`
	Port       int    `ini:"Port"`
	DBUser     string `ini:"DBUser"`
	DBPassword string `ini:"DBPassword"`
	DBConnTTL  int    `ini:"DBConnTTL"`
	ShowSql    bool   `ini:"ShowSql"`
	LogMode    bool   `ini:"LogMode"`
}

type LdapConf

type LdapConf struct {
	Enabled   bool        `ini:"Enabled"`
	Url       string      `ini:"Url"`
	BaseDN    string      `ini:"BaseDN"`
	BindDN    string      `ini:"BindDN"`
	Password  string      `ini:"Password"`
	UseSSL    bool        `ini:"UseSSL"`
	SkipTLS   bool        `ini:"SkipTLS"`
	TLSConfig *tls.Config `ini:"TLSConfig"`
	CertFile  string      `ini:"CertFile"`
	KeyFile   string      `ini:"KeyFile"`
	CAFile    string      `ini:"CAFile"`
	Filter    string      `ini:"Filter"`
	Uid       string      `ini:"Uid"`
	Scope     string      `ini:"Scope"`
}

type LogConf

type LogConf struct {
	LogLevel string `ini:"LogLevel"`
	LogPath  string `ini:"LogPath"`
}

type Oauth2Conf

type Oauth2Conf struct {
	Enabled      bool   `ini:"Enabled"`
	ClientId     string `ini:"ClientId"`
	ClientSecret string `ini:"ClientSecret"`
	RedirectURL  string `ini:"RedirectURL"`
	AuthURL      string `ini:"AuthURL"`
	TokenURL     string `ini:"TokenURL"`
	ApiURL       string `ini:"ApiURL"`
	Scopes       string `ini:"Scopes"`
	ApiMapping   string `ini:"ApiMapping"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳