middleware

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DoFunc

type DoFunc func(ctx context.Context, request *types.Request) (*types.Response, error)

func (DoFunc) Do

func (df DoFunc) Do(ctx context.Context, request *types.Request) (*types.Response, error)

type LogLevelType

type LogLevelType string
const (
	LogLevelTypeNoLog LogLevelType = ""
	LogLevelTypeDebug LogLevelType = "debug"
	LogLevelTypeInfo  LogLevelType = "info"
	LogLevelTypeError LogLevelType = "error"
)

type LogMiddleware

type LogMiddleware struct {
	*logger.Logger
	// contains filtered or unexported fields
}

func NewLogMiddleware

func NewLogMiddleware(name string, meta types.Metadata) (*LogMiddleware, error)

type MetricsMiddleware

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

func NewMetricsMiddleware

func NewMetricsMiddleware(cfg config.BindingConfig, exporter *metrics.Exporter) (*MetricsMiddleware, error)

type Middleware

type Middleware interface {
	Do(ctx context.Context, request *types.Request) (*types.Response, error)
}

func Chain

func Chain(md Middleware, list ...MiddlewareFunc) Middleware

type MiddlewareFunc

type MiddlewareFunc func(Middleware) Middleware

func Log

func Log(log *LogMiddleware) MiddlewareFunc

func Metric

func RateLimiter

func RateLimiter(rl *RateLimitMiddleware) MiddlewareFunc

func Retry

type RateLimitMiddleware

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

func NewRateLimitMiddleware

func NewRateLimitMiddleware(meta types.Metadata) (*RateLimitMiddleware, error)

func (*RateLimitMiddleware) Take

func (rl *RateLimitMiddleware) Take()

type RetryMiddleware

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

func NewRetryMiddleware

func NewRetryMiddleware(meta types.Metadata, log *logger.Logger) (*RetryMiddleware, error)

Jump to

Keyboard shortcuts

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