interceptor

package
v0.0.0-...-440c409 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorsInterceptor

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

func GetAccessInterceptor

func GetAccessInterceptor(client descAccess.AccessV1Client) func(
	ctx context.Context,
	req interface{},
	info *grpc.UnaryServerInfo,
	handler grpc.UnaryHandler,
) (interface{}, error)

func GetAccessStreamInterceptor

func GetAccessStreamInterceptor(client descAccess.AccessV1Client) func(
	srv interface{},
	ss grpc.ServerStream,
	info *grpc.StreamServerInfo,
	handler grpc.StreamHandler,
) error

func LogInterceptor

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

func MetricsInterceptor

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

func ServerTracingInterceptor

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

Types

type GRPCStatusInterface

type GRPCStatusInterface interface {
	GRPCStatus() *status.Status
}

type RateLimiterInterceptor

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

func NewRateLimiterInterceptor

func NewRateLimiterInterceptor(limiter *rate_limiter.TokenBucketLimiter) *RateLimiterInterceptor

func (*RateLimiterInterceptor) Unary

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

type UserClaims

type UserClaims struct {
	jwt.StandardClaims
	Username string `json:"username"`
	Role     int32  `json:"role"`
}

Jump to

Keyboard shortcuts

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