middleware

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextMiddleware

func ContextMiddleware(
	ctx context.Context,
	req interface{},
	info *grpc.UnaryServerInfo,
	handler grpc.UnaryHandler,
) (interface{}, error)

func LoggingInterceptor

func LoggingInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

func NewMetricsInterceptor

func NewMetricsInterceptor(
	requests *prometheus.CounterVec,
	latency *prometheus.HistogramVec,
) grpc.UnaryServerInterceptor

Types

type Cache

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

func NewCache

func NewCache(size int) (*Cache, error)

func (*Cache) InterceptorFunc

func (c *Cache) InterceptorFunc() grpc.UnaryServerInterceptor

type RateLimiter

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

func NewRateLimiter

func NewRateLimiter(rps float64, burst int) *RateLimiter

func (*RateLimiter) InterceptorFunc

func (r *RateLimiter) InterceptorFunc() grpc.UnaryServerInterceptor

Jump to

Keyboard shortcuts

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