advecho

package
v0.0.0-...-575c38c Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextKeyLimitAvailable = "advecho.limit/available"
)

Variables

This section is empty.

Functions

func Limit

func Limit(opts LimitOptions) echo.MiddlewareFunc

func LimitGetAvailable

func LimitGetAvailable(ctx echo.Context) (val int64, ok bool)

func Log

func Log(opts LogOptions) echo.MiddlewareFunc

func Logger

func Logger(ctx echo.Context) *zap.Logger

func Sugar

func Sugar(ctx echo.Context) *zap.SugaredLogger

func Trace

func Trace(opts TraceOptions) echo.MiddlewareFunc

Types

type Binder

type Binder struct{}

func (Binder) Bind

func (b Binder) Bind(i interface{}, c echo.Context) error

type LimitOptions

type LimitOptions struct {
	Limiter Limiter
}

type Limiter

type Limiter interface {
	Take()
	Available() int64
	Return()
}

func FixedBucketLimiter

func FixedBucketLimiter(capacity int64) Limiter

type LogOptions

type LogOptions struct {
	Tracer opentracing.Tracer
	Logger *zap.Logger
}

type TraceOptions

type TraceOptions struct {
	Tracer opentracing.Tracer
}

Jump to

Keyboard shortcuts

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