config

package
v0.0.0-...-bd2a5d7 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfigFromYaml

func LoadConfigFromYaml(filePath string) error

LoadConfigFromToml 从Toml文件中加载

Types

type App

type App struct {
	HTTP        *Server `mapstructure:"http"`
	Interaction *Server `mapstructure:"interaction"`
	Relation    *Server `mapstructure:"relation"`
}

type Config

type Config struct {
	Apps  *App   `mapstructure:"server"`
	Log   *Log   `mapstructure:"log"`
	MySQL *MySQL `mapstructure:"mysql" `
	Oss   *Oss   `mapstructure:"oss"`
}

Config 应用配置

func C

func C() *Config

type Log

type Log struct {
	Level        string `mapstructure:"level"`
	InfoFilename string `mapstructure:"infoFilename"`
	ErrFilename  string `mapstructure:"errFilename"`
	MaxSize      int    `mapstructure:"max_size"`
	MaxAge       int    `mapstructure:"max_age"`
	MaxBackups   int    `mapstructure:"max_backups"`
}

Log todo

type MySQL

type MySQL struct {
	Host         string `mapstructure:"host"`
	Port         string `mapstructure:"port"`
	User         string `mapstructure:"user"`
	Password     string `mapstructure:"password"`
	Dbname       string `mapstructure:"dbname"`
	MaxIdleConns int    `mapstructure:"max_idle_conns"`
	MaxOpenConns int    `mapstructure:"max_open_conns"`
}

MySQL todo

type Oss

type Oss struct {
	AccessKeyId     string `mapstructure:"ALI_AK"`
	AccessKeySecret string `mapstructure:"ALI_SK"`
	OssEndpoint     string `mapstructure:"ALI_OSS_ENDPOINT"`
	BucketName      string `mapstructure:"ALI_BUCKET_NAME"`
	OssVideoDir     string `mapstructure:"	OSS_VIDEO_DIR"`
	PlayUrlPrefix   string `mapstructure:"PLAY_URL_PREFIX"`
}

type Server

type Server struct {
	Name string `mapstructure:"name"`
	Mode string `mapstructure:"mode"`
	Host string `mapstructure:"host"`
	Port string `mapstructure:"port"`
}

func (*Server) GetAddr

func (s *Server) GetAddr() string

Jump to

Keyboard shortcuts

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