middleware

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List() map[string]Middleware

func Register

func Register(name string, m Middleware)

Types

type HandlerFunc

type HandlerFunc func(ctx context.Context, req Request, resp Response) error

type Middleware

type Middleware func(next HandlerFunc) HandlerFunc

func Get

func Get(name string) Middleware

type Request

type Request interface {
	// Client server or client
	Client() bool

	// Kind [http|grpc...]
	Kind() string

	// Stream Indicates whether it's a stream
	Stream() bool

	// Service name requested
	Service() string

	// Operation requested
	Operation() string

	// Endpoint requested
	Endpoint() string

	// ContentType Content type provided
	ContentType() string

	// Header of the request
	Header() *RequestHeader

	// Payload is the decoded value
	Payload() interface{}
}

Request is a synchronous request interface

type RequestHeader

type RequestHeader = fasthttp.RequestHeader

type Response

type Response interface {
	Header() *ResponseHeader
	Payload() interface{}
	Stream() bool
}

Response is the response writer for un encoded messages

type ResponseHeader

type ResponseHeader = fasthttp.ResponseHeader

Jump to

Keyboard shortcuts

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