rpc

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertErrorStreamClientInterceptor added in v2.0.6

func ConvertErrorStreamClientInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)

ConvertErrorStreamClientInterceptor returns a new stream client interceptor that convert error when trigger custom error.

func ConvertErrorStreamServerInterceptor added in v2.0.6

func ConvertErrorStreamServerInterceptor(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

ConvertErrorStreamServerInterceptor returns a new stream server interceptor that convert error when trigger custom error.

func ConvertErrorUnaryClientInterceptor added in v2.0.6

func ConvertErrorUnaryClientInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error

ConvertErrorUnaryClientInterceptor returns a new unary client interceptor that convert error when trigger custom error.

func ConvertErrorUnaryServerInterceptor added in v2.0.6

func ConvertErrorUnaryServerInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)

ConvertErrorUnaryServerInterceptor returns a new unary server interceptor that convert error when trigger custom error.

func NewClientCredentials added in v2.0.6

func NewClientCredentials(caCertFile string, certFile string, keyFile string) (credentials.TransportCredentials, error)

NewClientCredentials creates a new client credentials with the given ca certificate, certificate and key.

func NewInsecureCredentials added in v2.1.61

func NewInsecureCredentials() credentials.TransportCredentials

NewInsecureCredentials creates a new insecure credentials.

func NewServerCredentials added in v2.1.61

func NewServerCredentials(caCertFile string, certFile string, keyFile string) (credentials.TransportCredentials, error)

NewServerCredentials creates a new server credentials with the given ca certificate, certificate and key.

Types

type RateLimiterInterceptor added in v2.0.6

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

RateLimiterInterceptor is the interface for ratelimit interceptor.

func NewRateLimiterInterceptor added in v2.0.6

func NewRateLimiterInterceptor(qps float64, burst int64) *RateLimiterInterceptor

NewRateLimiterInterceptor returns a RateLimiterInterceptor instance.

func (*RateLimiterInterceptor) Limit added in v2.0.6

func (r *RateLimiterInterceptor) Limit() bool

Limit is the predicate which limits the requests.

Directories

Path Synopsis
cdnsystem
client/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
dfdaemon
client/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
health
client/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
manager
client/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
scheduler
client/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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