config

package
v0.0.0-...-a4179b6 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetConfig

func SetConfig(c Config)

Types

type Cache

type Cache struct {
	Endpoint    string `json:"endpoint"`
	Pwd         string `json:"pwd"`
	EnableSSL   bool   `json:"enable_ssl"`
	DB          int    `json:"db"`
	ConnTimeout int    `json:"conn_timeout"`
}

type Config

type Config struct {
	DeploymentEnv          string                `json:"deployment_env"`
	ServiceName            string                `json:"service_name"`
	ServiceGroupName       string                `json:"service_group_name"`
	ServiceGrpcEndpoint    string                `json:"service_grpc_endpoint"`
	ServiceHttpEndpoint    string                `json:"service_http_endpoint"`
	ServiceMetricsEndpoint string                `json:"service_metrics_endpoint"`
	LogLevel               string                `json:"log_level"`
	LogSentryDSN           string                `json:"log_sentry_dsn"`
	LogPrinter             string                `json:"log_printer"`
	LogPrinterFilePath     string                `json:"log_printer_filepath"`
	EnableReflection       bool                  `json:"enable_reflection"`
	ServiceInternalConfig  ServiceInternalConfig `json:"service_internal_config"`
}

func GetConfig

func GetConfig() *Config

func LoadConfigFileOrPanic

func LoadConfigFileOrPanic(fn string) *Config

func (*Config) UnmarshalJSON

func (conf *Config) UnmarshalJSON(data []byte) error

type ServiceInternalConfig

type ServiceInternalConfig struct {
	MerchantID                  string         `json:"merchant_id"`
	MerchantCertSerialNo        string         `json:"merchant_cert_serial_no"`
	MerchantAPIv3Key            string         `json:"merchant_api_v3_key"`
	MerchantAPIv3SecretCertPath string         `json:"merchant_api_v3_secret_cert_path"`
	SupportedAppList            []SupportedApp `json:"supported_app_list"`
	PaymentCallbackNotifyURL    string         `json:"payment_callback_notify_url"`
	PaymentExpireTimeInMinute   int64          `json:"payment_expire_time_in_minute"`
	Storage                     Storage        `json:"storage"`
	Cache                       Cache          `json:"cache"`
}

type Storage

type Storage struct {
	Endpoint    string `json:"endpoint"`
	RootUsr     string `json:"root_usr"`
	RootPwd     string `json:"root_pwd"`
	EnableSSL   bool   `json:"enable_ssl"`
	DB          string `json:"db"`
	ConnTimeout int    `json:"conn_timeout"`
}

type SupportedApp

type SupportedApp struct {
	AppID     string `json:"app_id"`
	AppSecret string `json:"app_secret"`
}

Jump to

Keyboard shortcuts

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