Documentation
¶
Index ¶
- Constants
- func GetDialOptions(agentConfig *config.Config, resourceID string) []grpc.DialOption
- func ProtoValidatorStreamClientInterceptor() (grpc.StreamClientInterceptor, error)
- func ProtoValidatorUnaryClientInterceptor() (grpc.UnaryClientInterceptor, error)
- func ValidateGrpcError(err error) error
- type GrpcConnection
- type GrpcConnectionInterface
- type PerRPCCredentials
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
func ValidateGrpcError ¶
Types ¶
type GrpcConnection ¶
type GrpcConnection struct {
// contains filtered or unexported fields
}
func NewGrpcConnection ¶
func (*GrpcConnection) CommandServiceClient ¶
func (gc *GrpcConnection) CommandServiceClient() mpi.CommandServiceClient
nolint: ireturn
func (*GrpcConnection) FileServiceClient ¶
func (gc *GrpcConnection) FileServiceClient() mpi.FileServiceClient
nolint: ireturn
func (*GrpcConnection) Restart ¶
func (gc *GrpcConnection) Restart(ctx context.Context) (*GrpcConnection, error)
type GrpcConnectionInterface ¶
type GrpcConnectionInterface interface { CommandServiceClient() mpi.CommandServiceClient FileServiceClient() mpi.FileServiceClient Close(ctx context.Context) error Restart(ctx context.Context) (*GrpcConnection, error) }
type PerRPCCredentials ¶
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.
Click to show internal directories.
Click to hide internal directories.