config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 5 Imported by: 0

README

upload 接口中的 ossType 由 oss.toml 中 appId 相同的最后一个 Oss 中的 OssType 决定

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() (err error)

Init init config.

Types

type Config

type Config struct {
	Env    string
	Server *HttpServer
	Redis  *Redis
	Oss    []*Oss
}

Config config.

var (
	Conf *Config
)

func Default

func Default() *Config

type HttpServer

type HttpServer struct {
	Addr string
}

type MySQL

type MySQL struct {
	Host string
	Port int32
	User string
	Pwd  string
	Db   string
}

MySQL .

type Oss

type Oss struct {
	AppId   string
	OssType string
	// RegionId 决定获得 tempKey 的速度快不快
	RegionId        string
	AccessKeyId     string
	AccessKeySecret string
	Role            string
	Policy          string
	DurationSeconds int
	Bucket          string
	// EndPoint 资源终端
	EndPoint  string
	PublicUrl string
}

type Redis

type Redis struct {
	Network      string
	Addr         string
	Auth         string
	Active       int
	Idle         int
	DialTimeout  xtime.Duration
	ReadTimeout  xtime.Duration
	WriteTimeout xtime.Duration
	IdleTimeout  xtime.Duration
	Expire       xtime.Duration
}

Redis .

Jump to

Keyboard shortcuts

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