Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrLogLevel = errors.New("log level is illegal") ErrLogPrefix = errors.New("log prefix is nil") ErrLogDir = errors.New("log dir is nil") ErrServerNameNil = errors.New("server name is nil") ErrConfigNil = errors.New("config nil") ErrRedisNameNil = errors.New("redis name is nil") ErrMysqlNameNil = errors.New("mysql name is nil") ErrMysqlIpNil = errors.New("mysql ip is nil") )
Functions ¶
This section is empty.
Types ¶
type DefaultServer ¶
type DefaultServer struct { Typ ServerTyp // contains filtered or unexported fields }
func NewDefaultServer ¶
func (*DefaultServer) AfterInit ¶
func (d *DefaultServer) AfterInit(serverFunc ...ServerFunc)
func (*DefaultServer) BeforeInit ¶
func (d *DefaultServer) BeforeInit(serverFunc ...ServerFunc)
func (*DefaultServer) GetConfig ¶
func (d *DefaultServer) GetConfig() config.ConfigParser
func (*DefaultServer) Run ¶
func (d *DefaultServer) Run(ctx context.Context, cancel context.CancelFunc) error
type Server ¶
type Server interface { // Execute after Run function. // AfterInit is only suitable for initialization functions, // not suitable executing complex logic. AfterInit(serverFunc ...ServerFunc) // Execute before Run function. // The framework may still load some necessary functions // before Run executes(like logger, service register). // BeforeInit is only suitable for initialization functions, // not suitable for executing complex logic. BeforeInit(serverFunc ...ServerFunc) // run frame // The function will block until an error is // reported in the process. Run(ctx context.Context, cancel context.CancelFunc) error GetConfig() config.ConfigParser }
type ServerFunc ¶
type ServerFunc func(ctx context.Context, config config.ConfigParser)
Click to show internal directories.
Click to hide internal directories.