Documentation ¶
Index ¶
- func CallInit() (err error)
- func GetCallStack(depth int) stack.CallStack
- func Init(appName string, opts ...gconf.Opt)
- func InitApp(appName, version string, opts ...gconf.Opt)
- func InitApp2(appName, version, logfilesize string, logfilenum int, opts ...gconf.Opt)
- func InitConfig(app, version string, opts ...gconf.Opt)
- func Must(err error, msg string, args ...interface{})
- func Panic(err error, msg string, args ...interface{})
- func RegisterInit(initfuncs ...func() error)
- func Unix(sec, nsec int64) time.Time
- type PanicError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallInit ¶ added in v0.21.0
func CallInit() (err error)
CallInit calls the registered initialization functions.
func GetCallStack ¶ added in v0.22.0
GetCallStack returns the stacks of the caller.
func Init ¶ added in v0.7.0
func Init(appName string, opts ...gconf.Opt)
Init is equal to InitApp(appName, gover.Text(), opts...).
func InitApp ¶
func InitApp(appName, version string, opts ...gconf.Opt)
InitApp initializes the application, which is equal to
InitApp2(appName, version, "100M", 100, opts...)
func InitApp2 ¶ added in v0.4.0
InitApp2 initializes the application.
- Register the log options.
- Initialize configuration.
- Initialize the logging.
- Call the registered initialization functions.
func InitConfig ¶
func InitConfig(app, version string, opts ...gconf.Opt)
InitConfig initializes the configuration, which will set the version, register the options, parse the CLI arguments with "flag", load the "flag", "env" and "file" sources.
func Must ¶ added in v0.15.0
Must logs the error with the msg and the program exits if err is not nil. Or do nothing.
func RegisterInit ¶ added in v0.21.0
func RegisterInit(initfuncs ...func() error)
RegisterInit registers the initialization functions.
Types ¶
type PanicError ¶ added in v0.22.0
PanicError is used to represent the panic error.
func NewPanicError ¶ added in v0.22.0
func NewPanicError(panic interface{}, depth int) PanicError
NewPanicError returns a new PanicError.
func (PanicError) Error ¶ added in v0.22.0
func (pe PanicError) Error() string
Directories ¶
Path | Synopsis |
---|---|
Package db supplies some assistant functions about the database.
|
Package db supplies some assistant functions about the database. |
Package exec supplies some convenient execution functions.
|
Package exec supplies some convenient execution functions. |
Package log is used to initialize the logger, and supplies some assistant functions about log.
|
Package log is used to initialize the logger, and supplies some assistant functions about log. |
Package net supplies some assistant functions about net, such as the gateway ip and routes.
|
Package net supplies some assistant functions about net, such as the gateway ip and routes. |
Package router suppies some router assistant functions, such as the router Handlers and Middlewares.
|
Package router suppies some router assistant functions, such as the router Handlers and Middlewares. |
Package validate supplies a struct validator to validate whether the field value of the struct is valid or not.
|
Package validate supplies a struct validator to validate whether the field value of the struct is valid or not. |