config

package
v0.0.0-...-41ad4b5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	LanguageEnUs = "en_us"
	LanguageZhCn = "zh_cn"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIServerCommonConfig

type APIServerCommonConfig struct {
	UserPhotoPath string `yaml:"user_photo_path"`
	UploadPath    string `yaml:"upload_path"`
}

type APIServerConfig

type APIServerConfig struct {
	AppName  string                  `yaml:"appname"`
	Logger   APIServerLoggerConfig   `yaml:"logger"`
	Listen   APIServerListenConfig   `yaml:"listen"`
	DB       DBConfig                `yaml:"db"`
	Cache    CacheConfig             `yaml:"cache"`
	Security APIServerSecurityConfig `yaml:"security"`
	Cookie   APIServerCookieConfig   `yaml:"cookie"`
	Sentry   APIServerSentryConfig   `yaml:"sentry"`
	Common   APIServerCommonConfig   `yaml:"common"`
	Mail     APIServerMailConfig     `yaml:"mail"`
	Language string                  `yaml:"language"`
}

func ApiServerConfig

func ApiServerConfig() *APIServerConfig

func NewAPIServerConfig

func NewAPIServerConfig(file string) (*APIServerConfig, error)

type APIServerCookieConfig

type APIServerCookieConfig struct {
	Expires string `yaml:"expires"`
}

type APIServerListenConfig

type APIServerListenConfig struct {
	Host                    string `yaml:"host"`
	Port                    int64  `yaml:"port"`
	Debug                   bool   `yaml:"debug"`
	GracefulShutdownTimeout string `yaml:"graceful_shutdown_timeout"`
}

type APIServerLoggerConfig

type APIServerLoggerConfig struct {
	Level string `yaml:"level"`
}

type APIServerMailConfig

type APIServerMailConfig struct {
	StationName string `yaml:"station_name"`
	Host        string `yaml:"host"`
	User        string `yaml:"user"`
	Password    string `yaml:"password"`
	Port        string `yaml:"port"`
}

type APIServerSecurityConfig

type APIServerSecurityConfig struct {
	AccountSalt string `yaml:"account_salt"`
	JWTSalt     string `yaml:"jwt_salt"`
}

type APIServerSentryConfig

type APIServerSentryConfig struct {
	DSN string `yaml:"dsn"`
}

type CacheConfig

type CacheConfig struct {
	Prefix   string   `yaml:"prefix"`
	Master   string   `yaml:"master"`
	Hosts    []string `yaml:"hosts"`
	DB       int      `yaml:"db"`
	Password string   `yaml:"password"`
	Type     string   `yaml:"type"`
}

type DBConfig

type DBConfig struct {
	Name     string `yaml:"name"`
	User     string `yaml:"user"`
	Host     string `yaml:"host"`
	Port     int64  `yaml:"port"`
	Password string `yaml:"password"`
}

type OpenAPIAuthConfig

type OpenAPIAuthConfig struct {
	JwtSalt string `yaml:"jwtSalt"`
}

type OpenAPIConfig

type OpenAPIConfig struct {
	Logger   OpenAPILoggerConfig `yaml:"logger"`
	HTTP     OpenAPIHTTPConfig   `yaml:"http"`
	Database DBConfig            `yaml:"database"`
	Auth     OpenAPIAuthConfig   `yaml:"auth"`
}

func NewOpenAPIServerConfig

func NewOpenAPIServerConfig(file string) (*OpenAPIConfig, error)

func OpenAPIServerConfig

func OpenAPIServerConfig() *OpenAPIConfig

type OpenAPIHTTPConfig

type OpenAPIHTTPConfig struct {
	Addr         string `yaml:"addr"`
	Port         int64  `yaml:"port"`
	ReadTimeout  int64  `yaml:"readTimeout"`
	WriteTimeout int64  `yaml:"writeTimeout"`
}

type OpenAPILoggerConfig

type OpenAPILoggerConfig struct {
	Info string `yaml:"info"`
}

Jump to

Keyboard shortcuts

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