grpc

package
v3.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 31 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	TokenKey = "authorization"
	UUID     = "uuid"
)

Variables

This section is empty.

Functions

func DialOptions added in v3.1.0

func DialOptions(agentConfig *config.Config, commandConfig *config.Command, resourceID string) []grpc.DialOption

func DialViaHTTPProxy added in v3.3.0

func DialViaHTTPProxy(ctx context.Context, proxyConf *config.Proxy, targetAddr string) (net.Conn, error)

DialViaHTTPProxy establishes a tunnel via HTTP CONNECT and returns a net.Conn

func ProtoValidatorStreamClientInterceptor

func ProtoValidatorStreamClientInterceptor() (grpc.StreamClientInterceptor, error)

func ProtoValidatorUnaryClientInterceptor

func ProtoValidatorUnaryClientInterceptor() (grpc.UnaryClientInterceptor, error)

Have to create our own UnaryClientInterceptor function since protovalidate only provides a UnaryServerInterceptor https://pkg.go.dev/github.com/grpc-ecosystem/go-grpc-middleware/v2@v2.1.0/interceptors/protovalidate

func ValidateGrpcError

func ValidateGrpcError(err error) error

Types

type GrpcConnection

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

func NewGrpcConnection

func NewGrpcConnection(ctx context.Context, agentConfig *config.Config,
	commandConfig *config.Command,
) (*GrpcConnection, error)

func (*GrpcConnection) Close

func (gc *GrpcConnection) Close(ctx context.Context) error

func (*GrpcConnection) CommandServiceClient

func (gc *GrpcConnection) CommandServiceClient() mpi.CommandServiceClient

func (*GrpcConnection) FileServiceClient

func (gc *GrpcConnection) FileServiceClient() mpi.FileServiceClient

type GrpcConnectionInterface

type GrpcConnectionInterface interface {
	CommandServiceClient() mpi.CommandServiceClient
	FileServiceClient() mpi.FileServiceClient
	Close(ctx context.Context) error
}

type PerRPCCredentials

type PerRPCCredentials struct {
	Token string
	ID    string
}

PerRPCCredentials implements the PerRPCCredentials interface.

func (*PerRPCCredentials) GetRequestMetadata

func (t *PerRPCCredentials) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

GetRequestMetadata returns the request metadata as a map.

func (*PerRPCCredentials) RequireTransportSecurity

func (t *PerRPCCredentials) RequireTransportSecurity() bool

RequireTransportSecurity indicates whether the credentials requires transport security.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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