grpc

package
v3.0.0-...-483f4b8 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func GetDialOptions

func GetDialOptions(agentConfig *config.Config, resourceID string) []grpc.DialOption

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

Types

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.

Jump to

Keyboard shortcuts

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