config

package
v0.0.0-...-2a6e696 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version string

Functions

func LoadConfig

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

Types

type API

type API struct {
	Secret string `mapstructure:"secret"`
	Expire int    `mapstructure:"expire"`
	Api    struct {
		ListenIP string `mapstructure:"listenIP"`
		Ports    []int  `mapstructure:"ports"`
	} `mapstructure:"api"`
	Prometheus struct {
		Enable     bool   `mapstructure:"enable"`
		Ports      []int  `mapstructure:"ports"`
		GrafanaURL string `mapstructure:"grafanaURL"`
	} `mapstructure:"prometheus"`
}

type Discovery

type Discovery struct {
	Enable string `mapstructure:"enable"`
	Etcd   Etcd   `mapstructure:"etcd"`
}

type Etcd

type Etcd struct {
	RootDirectory string   `mapstructure:"rootDirectory"`
	Address       []string `mapstructure:"address"`
	Username      string   `mapstructure:"username"`
	Password      string   `mapstructure:"password"`
}

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"`
	IsSimplify          bool   `mapstructure:"isSimplify"`
	WithStack           bool   `mapstructure:"withStack"`
}

type Meeting

type Meeting struct {
	RPC struct {
		RegisterIP string `mapstructure:"registerIP"`
		ListenIP   string `mapstructure:"listenIP"`
		Ports      []int  `mapstructure:"ports"`
	} `mapstructure:"rpc"`
	Prometheus Prometheus `mapstructure:"prometheus"`
}

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 Prometheus

type Prometheus struct {
	Enable bool  `mapstructure:"enable"`
	Ports  []int `mapstructure:"ports"`
}

type RTC

type RTC struct {
	URL       []string `mapstructure:"url"`
	ApiKey    string   `mapstructure:"apiKey"`
	ApiSecret string   `mapstructure:"apiSecret"`
	InnerURL  string   `mapstructure:"innerURL"`
}

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:"storage"`
	MaxRetry       int      `mapstructure:"MaxRetry"`
}

func (*Redis) Build

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

type RpcRegisterName

type RpcRegisterName struct {
	User    string `mapstructure:"user"`
	Meeting string `mapstructure:"meeting"`
}

type Share

type Share struct {
	RpcRegisterName RpcRegisterName `mapstructure:"rpcRegisterName"`
}

type User

type User struct {
	RPC struct {
		RegisterIP string `mapstructure:"registerIP"`
		ListenIP   string `mapstructure:"listenIP"`
		Ports      []int  `mapstructure:"ports"`
	} `mapstructure:"rpc"`
	Token struct {
		Secret  string `mapstructure:"secret"`
		Expires int    `mapstructure:"expire"`
	} `mapstructure:"token"`
	Prometheus Prometheus `mapstructure:"prometheus"`
}

Jump to

Keyboard shortcuts

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