config

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 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"`
	LiveKit struct {
		LiveKitUrl string `yaml:"liveKitUrl"`
		Key        string `yaml:"key"`
		Secret     string `yaml:"secret"`
	} `yaml:"liveKit"`
	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"`
	Mongo struct {
		Uri         string   `yaml:"uri"`
		Address     []string `yaml:"address"`
		Database    string   `yaml:"database"`
		Username    string   `yaml:"username"`
		Password    string   `yaml:"password"`
		MaxPoolSize int      `yaml:"maxPoolSize"`
	} `yaml:"mongo"`
	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 added in v1.4.0

func CreateCatalogPath(path string) []string

func FlagParse added in v1.4.0

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

func GetDefaultIMAdmin added in v1.1.1

func GetDefaultIMAdmin() string

func GetIMAdmin added in v1.1.1

func GetIMAdmin(chatAdminID string) string

func InitConfig

func InitConfig(configFile string) error

Types

type Admin added in v1.1.1

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