core

package
v0.0.0-...-70ad6e6 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: EPL-1.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SystemError = "001"

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(configPath string, configStruct interface{}, valid bool) error

Types

type ApiRequest

type ApiRequest struct {
	Cmd  string      `json:"cmd"`
	Data interface{} `json:"data"`
}

type ApiResponse

type ApiResponse struct {
	Code interface{} `json:"code"`
	Msg  interface{} `json:"msg"`
	Data interface{} `json:"data"`
}

func BuildFail

func BuildFail(code string, msg string) ApiResponse

func BuildOK

func BuildOK() ApiResponse

type AppConfig

type AppConfig struct {
	RunMode  bool
	AppName  string `yaml:"application"`
	Server   ServerConfig
	Database DatabaseConfig
	Redis    RedisConfig
	Log      Log
}

AppConfig 服务端配置数据结构

func GetAppConfig

func GetAppConfig() *AppConfig

type DatabaseConfig

type DatabaseConfig struct {
	Type     string
	User     string
	Password string
	Host     string
	DbName   string
	Charset  string
}

func GetDatabaseConfig

func GetDatabaseConfig() DatabaseConfig

type Log

type Log struct {
	Path string
}

func GetLogConfig

func GetLogConfig() Log

func (*Log) GetLogFilePath

func (*Log) GetLogFilePath() string

GetLogFilePath 获取日志文件路径

type RedisConfig

type RedisConfig struct {
	Host     string
	Password string
	Db       int
	PoolSize int
}

func GetRedisConfig

func GetRedisConfig() RedisConfig

type ServerConfig

type ServerConfig struct {
	Port         int
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
}

func GetServerConfig

func GetServerConfig() ServerConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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