config

package
v1.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2020 License: MIT Imports: 2 Imported by: 5

Documentation

Index

Constants

View Source
const (
	//APP NAME
	AppName = "Registry"
	//Usage
	Usage = "Registry Usage"
	//Vresion Num
	Version = "0.0.1"
	//Author Nmae
	Author = "LoadStack Developer Group"
	//Email Address
	Email = "oiooj@qq.com"
)

Variables

This section is empty.

Functions

func ParseConfig

func ParseConfig(path string) error

Types

type CommonConfig

type CommonConfig struct {
	Admins          []string `toml:"admins"`
	RouterAddr      string   `toml:"routeraddr"`
	PersistReport   int      `toml:"persistreport"`
	PID             string   `toml:"pid"`
	ProductionUsers []string `toml:"productionusers"`
}

type Config

type Config struct {
	CommonConf CommonConfig `toml:"common"`
	HTTPConf   HTTPConfig   `toml:"http"`
	DataConf   DataConfig   `toml:"data"`
	LDAPConf   LDAPConfig   `toml:"ldap"`
	WeworkConf WeworkConfig `toml:"wework"`
	DNSConf    DNSConfig    `toml:"dns"`
	LogConf    LogConfig    `toml:"log"`
	PluginConf PluginConfig `toml:"plugin"`
	EventConf  EventConfig  `toml:"event"`
}
var (

	// global config
	C Config
)

func GetConfig

func GetConfig() Config

type DNSConfig

type DNSConfig struct {
	Enable bool `toml:"enable"`
	Port   int  `toml:"port"`
}

DNSConig is DNS config struct

type DataConfig

type DataConfig struct {
	Dir           string `toml:"dir"`
	ClusterBind   string `toml:"clusterbind"`
	ClusterLeader string `toml:"clusterleader"`
}

type EventConfig

type EventConfig struct {
	ClearURL string `toml:"clearURL"`
}

type HTTPConfig

type HTTPConfig struct {
	Bind  string `toml:"bind"`
	Https bool   `toml:"https"`
	Cert  string `toml:"cert"`
	Key   string `toml:"key"`
}

type LDAPConfig

type LDAPConfig struct {
	Enable   bool   `toml:"enable"`
	Server   string `toml:"server"`
	UID      string `toml:"uid"`
	Binddn   string `toml:"binddn"`
	Password string `toml:"password"`
	Base     string `toml:"base"`
}

LDAPConfig is LDAP config struct

type LogConfig

type LogConfig struct {
	NS            string `toml:"ns"`
	Dir           string `toml:"logdir"`
	Level         string `toml:"loglevel"`
	Logrotatenum  int    `toml:"logrotatenum"`
	Logrotatesize uint64 `toml:"logrotatesize"`
}

LogConfig is log config struct

type PluginConfig

type PluginConfig struct {
	AlarmFile    string `toml:"alarmfile"`
	Branch       string `toml:"branch"`
	GitlabDomain string `toml:"gitlab"`
	Token        string `toml:"token"`
	Group        string `toml:"group"`
}

type WeworkConfig

type WeworkConfig struct {
	Enable     bool   `toml:"enable"`
	CorpID     string `toml:"corpid"`
	CorpSecret string `toml:"corpsecret"`
	Redirect   string `toml:"redirect"`
}

WeworkConfig is wework config struct

Jump to

Keyboard shortcuts

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