config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OSSConfig  OSS
	OSS_PREFIX string
	DEFAULT    Default
)

Functions

func Get

func Get(key string) interface{}

func GetString

func GetString(key string) string

func Init

func Init()

func MySQLDSN

func MySQLDSN() string

Types

type Default

type Default struct {
	Avatar        string `json:"avatar"`
	BackgroundIMG string `json:"backgroundIMG"`
	Signature     string `json:"signature"`
}

type MySQL

type MySQL struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	Database string `yaml:"database"`
}

type OSS

type OSS struct {
	Endpoint  string `yaml:"endpoint"`
	AccessKey string `yaml:"accessKey"`
	SecretKey string `yaml:"secretKey"`
	Region    string `yaml:"region"`
	Bucket    string `yaml:"bucket"`

	// 如果是使用 minio,并且没有使用 https,需要设置为 false
	UseSsl *bool `yaml:"useSsl"`
	// 如果是使用 minio,需要设置为 true
	HostnameImmutable *bool `yaml:"hostnameImmutable"`
}

type Redis

type Redis struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Password string `yaml:"password"`
	PoolSize int    `yaml:"poolSize"`
	Database int    `yaml:"database"`
}

Jump to

Keyboard shortcuts

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