setting

package
v0.0.0-...-46fca04 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENV_DEVELOPMENT = "development"
	ENV_STAGING     = "staging"
	ENV_PRODUCTION  = "production"

	OS_MAC   = "mac"
	OS_LINUX = "linux"
)

Variables

View Source
var (
	App         = &AppSetting{}
	GoogleOAuth = &GoogleOAuthSetting{}
	Server      = &ServerSetting{}
	Consul      = &ConsulSetting{}
	Redis       = &RedisSetting{}

	Database = &DatabaseSetting{}
)

Functions

func HasSettingChanged

func HasSettingChanged() bool

func Setup

func Setup()

Setup initialize the configuration instance

Types

type AppSetting

type AppSetting struct {
	ENV  string
	CORS string
	OS   string

	JWTAccessSecret  string
	JWTRefreshSecret string

	TickerTTL time.Duration

	LogSavePath string
	LogSaveName string
	LogFileExt  string
	TimeFormat  string
}

type ConsulSetting

type ConsulSetting struct {
	Address     string
	ServiceName string
	RootFolder  string
}

type DatabaseSetting

type DatabaseSetting struct {
	LocalURL    string
	DockerURL   string
	Retries     int
	MaxActive   int
	MaxIdle     int
	MaxLifetime time.Duration
}

type GoogleOAuthSetting

type GoogleOAuthSetting struct {
	ClientID    string
	SecretID    string
	RedirectURL string
}

type RedisSetting

type RedisSetting struct {
	Host        string
	Password    string
	MaxIdle     int
	MaxActive   int
	IdleTimeout time.Duration
	Salt        string
}

type ServerSetting

type ServerSetting struct {
	RunMode      string
	HttpPort     int
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
}

Jump to

Keyboard shortcuts

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