config

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: GPL-3.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//go:embed version
	Version string
	//go:embed template.xlsx
	ImportTemplate []byte
)

Functions

func LoadConfig

func LoadConfig(path string, envPrefix string, config any) error

Types

type API

type API struct {
	Api struct {
		ListenIP string `mapstructure:"listenIP"`
		Ports    []int  `mapstructure:"ports"`
	} `mapstructure:"api"`
}

type Admin

type Admin struct {
	RPC struct {
		RegisterIP string `mapstructure:"registerIP"`
		ListenIP   string `mapstructure:"listenIP"`
		Ports      []int  `mapstructure:"ports"`
	} `mapstructure:"rpc"`
	TokenPolicy struct {
		Expire int `mapstructure:"expire"`
	} `mapstructure:"tokenPolicy"`
	Secret string `mapstructure:"secret"`
}

type AdminUser

type AdminUser struct {
	AdminID  string `mapstructure:"adminID"`
	IMUserID string `mapstructure:"imUserID"`
	Nickname string `mapstructure:"nickname"`
}

type Chat

type Chat struct {
	RPC struct {
		RegisterIP string `mapstructure:"registerIP"`
		ListenIP   string `mapstructure:"listenIP"`
		Ports      []int  `mapstructure:"ports"`
	} `mapstructure:"rpc"`
	VerifyCode struct {
		ValidTime  int    `mapstructure:"validTime"`
		ValidCount int    `mapstructure:"validCount"`
		UintTime   int    `mapstructure:"uintTime"`
		MaxCount   int    `mapstructure:"maxCount"`
		SuperCode  string `mapstructure:"superCode"`
		Len        int    `mapstructure:"len"`
		Phone      struct {
			Use string `mapstructure:"use"`
			Ali struct {
				Endpoint                     string `mapstructure:"endpoint"`
				AccessKeyID                  string `mapstructure:"accessKeyId"`
				AccessKeySecret              string `mapstructure:"accessKeySecret"`
				SignName                     string `mapstructure:"signName"`
				VerificationCodeTemplateCode string `mapstructure:"verificationCodeTemplateCode"`
			} `mapstructure:"ali"`
		} `mapstructure:"phone"`
		Mail struct {
			Enable                  bool   `mapstructure:"enable"`
			Title                   string `mapstructure:"title"`
			SenderMail              string `mapstructure:"senderMail"`
			SenderAuthorizationCode string `mapstructure:"senderAuthorizationCode"`
			SMTPAddr                string `mapstructure:"smtpAddr"`
			SMTPPort                int    `mapstructure:"smtpPort"`
		} `mapstructure:"mail"`
	} `mapstructure:"verifyCode"`
	LiveKit struct {
		URL    string `mapstructure:"url"`
		Key    string `mapstructure:"key"`
		Secret string `mapstructure:"secret"`
	} `mapstructure:"liveKit"`
}

type Log

type Log struct {
	StorageLocation     string `mapstructure:"storageLocation"`
	RotationTime        uint   `mapstructure:"rotationTime"`
	RemainRotationCount uint   `mapstructure:"remainRotationCount"`
	RemainLogLevel      int    `mapstructure:"remainLogLevel"`
	IsStdout            bool   `mapstructure:"isStdout"`
	IsJson              bool   `mapstructure:"isJson"`
	WithStack           bool   `mapstructure:"withStack"`
}

type Mongo

type Mongo struct {
	URI         string   `mapstructure:"uri"`
	Address     []string `mapstructure:"address"`
	Database    string   `mapstructure:"database"`
	Username    string   `mapstructure:"username"`
	Password    string   `mapstructure:"password"`
	MaxPoolSize int      `mapstructure:"maxPoolSize"`
	MaxRetry    int      `mapstructure:"maxRetry"`
}

func (*Mongo) Build

func (m *Mongo) Build() *mongoutil.Config

type Redis

type Redis struct {
	Address        []string `mapstructure:"address"`
	Username       string   `mapstructure:"username"`
	Password       string   `mapstructure:"password"`
	EnablePipeline bool     `mapstructure:"enablePipeline"`
	ClusterMode    bool     `mapstructure:"clusterMode"`
	DB             int      `mapstructure:"db"`
	MaxRetry       int      `mapstructure:"MaxRetry"`
}

func (*Redis) Build

func (r *Redis) Build() *redisutil.Config

type RpcRegisterName

type RpcRegisterName struct {
	Chat  string `mapstructure:"chat"`
	Admin string `mapstructure:"admin"`
}

type Share

type Share struct {
	Env             string          `mapstructure:"env"`
	RpcRegisterName RpcRegisterName `mapstructure:"rpcRegisterName"`
	OpenIM          struct {
		ApiURL      string `mapstructure:"apiURL"`
		Secret      string `mapstructure:"secret"`
		AdminUserID string `mapstructure:"adminUserID"`
	} `mapstructure:"openIM"`
	ChatAdmin   []AdminUser `mapstructure:"chatAdmin"`
	ProxyHeader string      `mapstructure:"proxyHeader"`
}

type ZooKeeper

type ZooKeeper struct {
	Schema   string   `mapstructure:"schema"`
	Address  []string `mapstructure:"address"`
	Username string   `mapstructure:"username"`
	Password string   `mapstructure:"password"`
}

Jump to

Keyboard shortcuts

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