Documentation ¶
Index ¶
- func GenerateCert(host string) ([]byte, []byte, error)
- func NewSimpleLogger() log.Logger
- type Serve
- func (s *Serve) AtLast(m func(ctx *fasthttp.RequestCtx) *fasthttp.RequestCtx)
- func (s *Serve) SetHandle(h fasthttp.RequestHandler)
- func (s *Serve) SetHostname(hostname string)
- func (s *Serve) SetIdleTimeout(sec int)
- func (s *Serve) SetLogger(l SimpleLogger)
- func (s *Serve) SetRouter(handler router.IRouterHandler)
- func (s *Serve) SetSslKeyCert(keyPath, certPath string)
- func (s *Serve) Start()
- func (s *Serve) StartTls()
- func (s *Serve) UseMiddleWare(m func(ctx *fasthttp.RequestCtx) *fasthttp.RequestCtx)
- type SimpleLogger
- type StartHttpServer
- type StartTlsServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSimpleLogger ¶
Types ¶
type Serve ¶
type Serve struct {
// contains filtered or unexported fields
}
func (*Serve) AtLast ¶
func (s *Serve) AtLast(m func(ctx *fasthttp.RequestCtx) *fasthttp.RequestCtx)
func (*Serve) SetHandle ¶
func (s *Serve) SetHandle(h fasthttp.RequestHandler)
func (*Serve) SetHostname ¶
func (*Serve) SetIdleTimeout ¶
func (*Serve) SetLogger ¶
func (s *Serve) SetLogger(l SimpleLogger)
func (*Serve) SetRouter ¶
func (s *Serve) SetRouter(handler router.IRouterHandler)
func (*Serve) SetSslKeyCert ¶
func (*Serve) UseMiddleWare ¶
func (s *Serve) UseMiddleWare(m func(ctx *fasthttp.RequestCtx) *fasthttp.RequestCtx)
type SimpleLogger ¶
type SimpleLogger interface { Infof(string, ...interface{}) Warnf(string, ...interface{}) Debugf(string, ...interface{}) Errorf(string, ...interface{}) Fatalf(string, ...interface{}) }
simply logger
type StartHttpServer ¶
type StartHttpServer interface { SetLogger(l SimpleLogger) SetHostname(hostname string) SetRouter(handler router.IRouterHandler) SetIdleTimeout(sec int) Start() UseMiddleWare(m func(ctx *fasthttp.RequestCtx) *fasthttp.RequestCtx) AtLast(m func(ctx *fasthttp.RequestCtx) *fasthttp.RequestCtx) }
func NewHttpServe ¶
func NewHttpServe(ip, port string) StartHttpServer
new simple http server you can set your http server before start()
type StartTlsServer ¶
type StartTlsServer interface { SetLogger(l SimpleLogger) SetHostname(hostname string) SetRouter(handler router.IRouterHandler) SetIdleTimeout(sec int) StartTls() AtLast(m func(ctx *fasthttp.RequestCtx) *fasthttp.RequestCtx) UseMiddleWare(m func(ctx *fasthttp.RequestCtx) *fasthttp.RequestCtx) }
Click to show internal directories.
Click to hide internal directories.