http

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCert

func GenerateCert(host string) ([]byte, []byte, error)

func NewSimpleLogger

func NewSimpleLogger() log.Logger

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 (s *Serve) SetHostname(hostname string)

func (*Serve) SetIdleTimeout

func (s *Serve) SetIdleTimeout(sec int)

func (*Serve) SetLogger

func (s *Serve) SetLogger(l SimpleLogger)

func (*Serve) SetRouter

func (s *Serve) SetRouter(handler router.IRouterHandler)

func (*Serve) SetSslKeyCert

func (s *Serve) SetSslKeyCert(keyPath, certPath string)

func (*Serve) Start

func (s *Serve) Start()

func (*Serve) StartTls

func (s *Serve) StartTls()

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)
}

func NewTLSServe

func NewTLSServe(ip, port string) StartTlsServer

ditto ↑

Jump to

Keyboard shortcuts

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