rpc

package
v3.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Set grpc version on compile time to compare against server version response.
	ClientGrpcVersion int32 = proto.Version
)

Variables

This section is empty.

Functions

func NewGrpcClient

func NewGrpcClient(ctx context.Context, conn *grpc.ClientConn) rpc.Peer

NewGrpcClient returns a new grpc Client.

Types

type AuthClient

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

func NewAuthGrpcClient

func NewAuthGrpcClient(conn *grpc.ClientConn, agentToken string, agentID int64) *AuthClient

func (*AuthClient) Auth

func (c *AuthClient) Auth(ctx context.Context) (string, int64, error)

type AuthInterceptor

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

AuthInterceptor is a client interceptor for authentication.

func NewAuthInterceptor

func NewAuthInterceptor(ctx context.Context, authClient *AuthClient, refreshDuration time.Duration) (*AuthInterceptor, error)

NewAuthInterceptor returns a new auth interceptor.

func (*AuthInterceptor) Stream

func (interceptor *AuthInterceptor) Stream() grpc.StreamClientInterceptor

Stream returns a client interceptor to authenticate stream RPC.

func (*AuthInterceptor) Unary

func (interceptor *AuthInterceptor) Unary() grpc.UnaryClientInterceptor

Unary returns a client interceptor to authenticate unary RPC.

Jump to

Keyboard shortcuts

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