middleware

package
v0.0.0-...-6c8972c Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthForwarder

func AuthForwarder() grpc.UnaryClientInterceptor

func CSRF

func CSRF(logger *logrus.Entry, secret []byte, opts ...csrf.Option) func(h http.Handler) http.Handler

func ChainHTTPMiddleware

func ChainHTTPMiddleware(usr *mux.Router, logger *logrus.Entry, mw ...func(http.Handler) http.Handler)

func ContentType

func ContentType(logger *logrus.Entry, typeDefault string) func(http.Handler) http.Handler

func GetIP

func GetIP(r *http.Request) string

func Gzip

func Gzip(handler http.Handler) http.Handler

func Logger

func Logger(logger *logrus.Entry) func(h http.Handler) http.Handler

func New

New creates a gRPC middleware chain.

Types

type Config

type Config struct {
	LogOpts []grpc_logrus.Option
}

type PublicEndpoint

type PublicEndpoint interface {
	PublicEndpoint(method string) bool
}

type RequestMeta

type RequestMeta interface {
	Metadata(context.Context) (context.Context, error)
}

type Service

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

func NewMetadata

func NewMetadata(logger logrus.FieldLogger, metaLoaders ...RequestMeta) (*Service, error)

func (*Service) UnaryServerInterceptor

func (s *Service) UnaryServerInterceptor() grpc.UnaryServerInterceptor

Jump to

Keyboard shortcuts

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