interceptors

package
v0.4.19 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package interceptors provides the interceptors for RPC.

Index

Constants

View Source
const (
	// SlowThreshold is the threshold for slow RPC.
	SlowThreshold = 100 * gotime.Millisecond
)

Variables

View Source
var ErrUnauthenticated = errors.New("authorization is not provided")

ErrUnauthenticated is returned when authentication is failed.

Functions

This section is empty.

Types

type AdminAuthInterceptor added in v0.4.0

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

AdminAuthInterceptor is an interceptor for authentication.

func NewAdminAuthInterceptor added in v0.4.0

func NewAdminAuthInterceptor(be *backend.Backend, tokenManager *auth.TokenManager) *AdminAuthInterceptor

NewAdminAuthInterceptor creates a new instance of AdminAuthInterceptor.

func (*AdminAuthInterceptor) WrapStreamingClient added in v0.4.11

WrapStreamingClient creates a stream client interceptor for authentication.

func (*AdminAuthInterceptor) WrapStreamingHandler added in v0.4.11

WrapStreamingHandler creates a stream server interceptor for authentication.

func (*AdminAuthInterceptor) WrapUnary added in v0.4.11

WrapUnary creates a unary server interceptor for authentication.

type ContextInterceptor

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

ContextInterceptor is an interceptor for building additional context.

func NewContextInterceptor

func NewContextInterceptor(be *backend.Backend) *ContextInterceptor

NewContextInterceptor creates a new instance of ContextInterceptor.

func (*ContextInterceptor) WrapStreamingClient added in v0.4.11

WrapStreamingClient creates a stream client interceptor for building additional context.

func (*ContextInterceptor) WrapStreamingHandler added in v0.4.11

WrapStreamingHandler creates a stream server interceptor for building additional context.

func (*ContextInterceptor) WrapUnary added in v0.4.11

WrapUnary creates a unary server interceptor for building additional context.

type DefaultInterceptor

type DefaultInterceptor struct{}

DefaultInterceptor is a interceptor for default.

func NewDefaultInterceptor

func NewDefaultInterceptor() *DefaultInterceptor

NewDefaultInterceptor creates a new instance of DefaultInterceptor.

func (*DefaultInterceptor) WrapStreamingClient added in v0.4.11

WrapStreamingClient creates a stream client interceptor for default.

func (*DefaultInterceptor) WrapStreamingHandler added in v0.4.11

WrapStreamingHandler creates a stream server interceptor for default.

func (*DefaultInterceptor) WrapUnary added in v0.4.11

WrapUnary creates a unary server interceptor for default.

Jump to

Keyboard shortcuts

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