middleware

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRPCAuthDialOptions

func GetRPCAuthDialOptions(conf *setting.RPCAuthSettingS) (opts []grpc.DialOption)

func GetRPCPerAuthHeader

func GetRPCPerAuthHeader(secret string) (map[string]string, error)

GetRPCPerAuthHeader 根据私钥获取RPC 接入auth header

func RPCPerCredentials

func RPCPerCredentials(sharedSecret string) credentials.PerRPCCredentials

Types

type AuthInfo

type AuthInfo struct {
	Version       string
	SignedMessage []byte
	Message       string
}

type Limiter

type Limiter interface {
	Limit() bool
	ReturnTicket()
}

func NewKelvinsRateLimit

func NewKelvinsRateLimit(maxConcurrent int) Limiter

type RPCPerAuthInterceptor

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

func NewRPCPerAuthInterceptor

func NewRPCPerAuthInterceptor(errLogger log.LoggerContextIface) *RPCPerAuthInterceptor

func (*RPCPerAuthInterceptor) StreamServerInterceptor

func (i *RPCPerAuthInterceptor) StreamServerInterceptor(conf *setting.RPCAuthSettingS) grpc.StreamServerInterceptor

func (*RPCPerAuthInterceptor) UnaryServerInterceptor

func (i *RPCPerAuthInterceptor) UnaryServerInterceptor(conf *setting.RPCAuthSettingS) grpc.UnaryServerInterceptor

type RPCRateLimitInterceptor

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

func NewRPCRateLimitInterceptor

func NewRPCRateLimitInterceptor(maxConcurrent int) *RPCRateLimitInterceptor

func (*RPCRateLimitInterceptor) StreamServerInterceptor

func (r *RPCRateLimitInterceptor) StreamServerInterceptor() grpc.StreamServerInterceptor

func (*RPCRateLimitInterceptor) UnaryServerInterceptor

func (r *RPCRateLimitInterceptor) UnaryServerInterceptor() grpc.UnaryServerInterceptor

Jump to

Keyboard shortcuts

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