Documentation ¶
Index ¶
Constants ¶
View Source
const (
VERSION = "v0.0.1"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { Name string Host string Port int64 Config *config.Config LoadConfig func() error SetupVars func() error // RegisterModule func() error RegisterCallback map[CallbackPosition]CallbackFunc }
type CallbackFunc ¶
type CallbackFunc func() error
type CallbackPosition ¶
type CallbackPosition int
const ( // 在 InitGlobalConfig 后调用 POSITION_GLOBAL_CONFIG CallbackPosition = iota + 1 // 在 InitGlobalLogger 后调用 POSITION_INIT_LOGGER // 在 Module Register 后调用 POSITION_MODULE_REGISTER // 调用 LoadConfig 方法后 POSITION_LOAD_CONFIG // 调用 SetupVars 方法后 POSITION_SETUP_VARS // 调用 New 方法后 POSITION_NEW )
type DatabaseIface ¶
var Database DatabaseIface
type GinApplication ¶
type LoggerIface ¶
type LoggerIface interface { // 普通日志 Info(ctx context.Context, args ...interface{}) Infof(ctx context.Context, format string, args ...interface{}) // 警告日志 Warn(ctx context.Context, args ...interface{}) Warnf(ctx context.Context, format string, args ...interface{}) // 错误日志 Error(ctx context.Context, args ...interface{}) Errorf(ctx context.Context, format string, args ...interface{}) }
var Logger LoggerIface
Click to show internal directories.
Click to hide internal directories.