middleware

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: BSD-3-Clause Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SupportedPlugins = make(map[string]NewFunc)
)

Functions

func GetHashFunc

func GetHashFunc(a string) (f func(b []byte) string)

GetHashFunc get hash func

func RegisterPlugin

func RegisterPlugin(name string, plugin NewFunc)

Types

type Config

type Config struct {
	Logger log.Logger
	Router *fasthttprouter.Router
	Path   string
}

type Helloworld

type Helloworld struct {
	// contains filtered or unexported fields
}

func (*Helloworld) Handler

func (p *Helloworld) Handler() fasthttp.RequestHandler

func (*Helloworld) Init

func (p *Helloworld) Init(c *Config) (err error)

func (*Helloworld) Process

func (*Helloworld) UnInit

func (p *Helloworld) UnInit()

type NewFunc

type NewFunc func() Plugin

type Plugin

type Plugin interface {
	Init(c *Config) error
	UnInit()
	Process(fasthttp.RequestHandler) fasthttp.RequestHandler
	Handler() fasthttp.RequestHandler
}

type Recover

type Recover struct {
	Log log.Logger
}

func (*Recover) Handler

func (p *Recover) Handler() fasthttp.RequestHandler

func (*Recover) Init

func (p *Recover) Init(c *Config) (err error)

func (*Recover) Process

func (*Recover) UnInit

func (p *Recover) UnInit()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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