config

package
v0.0.0-...-e575721 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	EnvVarPrefix string           `json:"env-var-prefix"`
	ServiceName  string           `json:"service-name"`
	ServerAddr   string           `json:"server-addr"` // addr:port
	AppSalt      string           `json:"appsalt"`
	QueueNum     int              `json:"queue-num"`
	Fs           FilesystemConfig `json:"filesystem"`
	DB           DatabaseConfig   `json:"database"`
	Redis        RedisConfig      `json:"redis"`
	Ticket       TicketConfig     `json:"ticket"`
	Minio        MinioConfig      `json:"minio"`
	Nos          NosConfig        `json:"nos"`
	ImageProxy   ImageProxyConfig `json:"image-proxy"`
}

func LoadConfig

func LoadConfig(filepath string) *Config

type DatabaseConfig

type DatabaseConfig struct {
	Driver   string `json:"driver"`
	Host     string `json:"host"`
	Port     string `json:"port"`
	User     string `json:"user"`
	Password string `json:"password"`
	DBName   string `json:"dbname"`
}

type FilesystemConfig

type FilesystemConfig struct {
	Driver string `json:"driver"`
	Root   string `json:"root"`
}

type ImageProxyConfig

type ImageProxyConfig struct {
	Host        string
	OmitBaseUrl string `json:"omitbaseurl"`
}

type MinioConfig

type MinioConfig struct {
	Host       string `json:"host"`
	AccessKey  string `json:"accesskey"`
	SecretKey  string `json:"secretkey"`
	SSL        string `json:"ssl"`
	BucketName string `json:"bucketname"`
}

type NosConfig

type NosConfig struct {
	Endpoint         string `json:"endpoint"`
	AccessKey        string `json:"accesskey"`
	SecretKey        string `json:"secretkey"`
	BucketName       string `json:"bucketname"`
	ExternalEndpoint string `json:"external-endpoint"`
}

type RedisConfig

type RedisConfig struct {
	Address string `json:"address"`
	Port    string `json:"port"`
}

type TicketConfig

type TicketConfig struct {
	Driver string `json:"driver"` // ticket 使用的驱动 只支持 redis 和 database
	TTL    int64  `json:"ttl"`    // ticket 的过期时间 (毫秒)
}

Jump to

Keyboard shortcuts

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