config

package
v0.0.0-...-5e1152d Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//go:embed version
	Version string
	//go:embed template.xlsx
	ImportTemplate []byte
)
View Source
var Config struct {
	Envs struct {
		Discovery string `yaml:"discovery"`
	} `yaml:"envs"`
	Zookeeper struct {
		Schema   string   `yaml:"schema"`
		ZkAddr   []string `yaml:"zkAddr"`
		Username string   `yaml:"username"`
		Password string   `yaml:"password"`
	} `yaml:"zookeeper"`
	ChatApi struct {
		GinPort  []int  `yaml:"openImChatApiPort"`
		ListenIP string `yaml:"listenIP"`
	} `yaml:"chatApi"`
	AdminApi struct {
		GinPort  []int  `yaml:"openImAdminApiPort"`
		ListenIP string `yaml:"listenIP"`
	} `yaml:"adminApi"`
	Rpc struct {
		RegisterIP string `yaml:"registerIP"`
		ListenIP   string `yaml:"listenIP"`
	} `yaml:"rpc"`
	Redis struct {
		Address  *[]string `yaml:"address"`
		Username string    `yaml:"username"`
		Password string    `yaml:"password"`
	} `yaml:"redis"`
	RpcPort struct {
		OpenImAdminPort []int `yaml:"openImAdminPort"`
		OpenImChatPort  []int `yaml:"openImChatPort"`
	} `yaml:"rpcPort"`
	RpcRegisterName struct {
		OpenImAdminName string `yaml:"openImAdminName"`
		OpenImChatName  string `yaml:"openImChatName"`
	} `yaml:"rpcRegisterName"`
	Mysql struct {
		Address       *[]string `yaml:"address"`
		Username      *string   `yaml:"username"`
		Password      *string   `yaml:"password"`
		Database      *string   `yaml:"database"`
		MaxOpenConn   *int      `yaml:"maxOpenConn"`
		MaxIdleConn   *int      `yaml:"maxIdleConn"`
		MaxLifeTime   *int      `yaml:"maxLifeTime"`
		LogLevel      *int      `yaml:"logLevel"`
		SlowThreshold *int      `yaml:"slowThreshold"`
	} `yaml:"mysql"`
	Log struct {
		StorageLocation     *string `yaml:"storageLocation"`
		RotationTime        *uint   `yaml:"rotationTime"`
		RemainRotationCount *uint   `yaml:"remainRotationCount"`
		RemainLogLevel      *int    `yaml:"remainLogLevel"`
		IsStdout            *bool   `yaml:"isStdout"`
		IsJson              *bool   `yaml:"isJson"`
		WithStack           *bool   `yaml:"withStack"`
	} `yaml:"log"`
	Secret      *string `yaml:"secret"`
	ChatSecret  string  `yaml:"chatSecret"`
	OpenIMUrl   string  `yaml:"openIMUrl"`
	TokenPolicy struct {
		Expire *int64 `yaml:"expire"`
	} `yaml:"tokenPolicy"`
	VerifyCode struct {
		ValidTime int    `yaml:"validTime"`
		UintTime  int    `yaml:"uintTime"`
		MaxCount  int    `yaml:"maxCount"`
		SuperCode string `yaml:"superCode"`
		Len       int    `yaml:"len"`
		Use       string `yaml:"use"`
		Ali       struct {
			Endpoint                     string `yaml:"endpoint"`
			AccessKeyId                  string `yaml:"accessKeyId"`
			AccessKeySecret              string `yaml:"accessKeySecret"`
			SignName                     string `yaml:"signName"`
			VerificationCodeTemplateCode string `yaml:"verificationCodeTemplateCode"`
		} `yaml:"ali"`
		Mail struct {
			Title                   string `yaml:"title"`
			SenderMail              string `yaml:"senderMail"`
			SenderAuthorizationCode string `yaml:"senderAuthorizationCode"`
			SmtpAddr                string `yaml:"smtpAddr"`
			SmtpPort                int    `yaml:"smtpPort"`
		} `yaml:"mail"`
	} `yaml:"verifyCode"`
	ProxyHeader string  `yaml:"proxyHeader"`
	AdminList   []Admin `yaml:"adminList"`
	ChatAdmin   []Admin `yaml:"chatAdmin"`
}
View Source
var (

	// Root folder of this project.
	Root = filepath.Join(filepath.Dir(b), "../..")
)

Functions

func CreateCatalogPath

func CreateCatalogPath(path string) []string

func FlagParse

func FlagParse() (string, int, bool, bool, error)

func GetDefaultIMAdmin

func GetDefaultIMAdmin() string

func GetIMAdmin

func GetIMAdmin(chatAdminID string) string

func InitConfig

func InitConfig(configFile string) error

Types

type Admin

type Admin struct {
	AdminID   string `yaml:"adminID"`
	NickName  string `yaml:"nickname"`
	ImAdminID string `yaml:"imAdmin"`
}

Jump to

Keyboard shortcuts

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