middleware

package
v0.1.28 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Registry

func Registry(x MiddlewareBuilder)

Types

type Config

type Config struct {
	Name string     `json:"name" yaml:"name"`
	Data RawMessage `json:"data" yaml:"data"`
}

type Handler

type Handler func(context.Context) interface{}

func (Handler) Handle

func (hfunc Handler) Handle(ctx context.Context) interface{}

type Middleware

type Middleware func(Handler) Handler

Middleware is HTTP/gRPC/Mqc/Cron transport middleware.

func Chain

func Chain(m ...Middleware) Middleware

Chain returns a Middleware that specifies the chained handler for endpoint.

func Resolve

func Resolve(m *Config) Middleware

type MiddlewareBuilder

type MiddlewareBuilder interface {
	Build(data RawMessage) Middleware
	Name() string
}

type RawMessage

type RawMessage struct {
	Data  []byte
	Codec string
}

func (*RawMessage) MarshalJSON

func (m *RawMessage) MarshalJSON() ([]byte, error)

MarshalJSON returns m as the JSON encoding of m.

func (*RawMessage) MarshalYAML

func (m *RawMessage) MarshalYAML() (interface{}, error)

func (*RawMessage) UnmarshalJSON

func (m *RawMessage) UnmarshalJSON(data []byte) error

UnmarshalJSON sets *m to a copy of data.

func (*RawMessage) UnmarshalYAML

func (m *RawMessage) UnmarshalYAML(value *yaml.Node) error

Directories

Path Synopsis
auth
jwt

Jump to

Keyboard shortcuts

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