grpc

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 22 Imported by: 87

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockingDial added in v0.3.0

func BlockingDial(ctx context.Context, network, address string, creds credentials.TransportCredentials, opts ...grpc.DialOption) (*grpc.ClientConn, error)

BlockingDial is a helper method to dial the given address, using optional TLS credentials, and blocking until the returned connection is ready. If the given credentials are nil, the connection will be insecure (plain-text). Lifted from: https://github.com/fullstorydev/grpcurl/blob/master/grpcurl.go

func ErrorCodeStreamServerInterceptor added in v0.3.0

func ErrorCodeStreamServerInterceptor() grpc.StreamServerInterceptor

ErrorCodeStreamServerInterceptor replaces Kubernetes errors with relevant gRPC equivalents, if any.

func ErrorCodeUnaryServerInterceptor added in v0.3.0

func ErrorCodeUnaryServerInterceptor() grpc.UnaryServerInterceptor

ErrorCodeUnaryServerInterceptor replaces Kubernetes errors with relevant gRPC equivalents, if any.

func MustMarshal added in v1.7.0

func MustMarshal(v interface{}) []byte

MustMarshal is a convenience function to marshal an object successfully or panic

func PanicLoggerStreamServerInterceptor

func PanicLoggerStreamServerInterceptor(log *logrus.Entry) grpc.StreamServerInterceptor

PanicLoggerStreamServerInterceptor returns a new streaming server interceptor for recovering from panics and returning error

func PanicLoggerUnaryServerInterceptor

func PanicLoggerUnaryServerInterceptor(log *logrus.Entry) grpc.UnaryServerInterceptor

PanicLoggerUnaryServerInterceptor returns a new unary server interceptor for recovering from panics and returning error

func PayloadStreamServerInterceptor added in v0.7.0

func PayloadStreamServerInterceptor(entry *logrus.Entry, logClaims bool, decider grpc_logging.ServerPayloadLoggingDecider) grpc.StreamServerInterceptor

func PayloadUnaryServerInterceptor added in v0.7.0

func PayloadUnaryServerInterceptor(entry *logrus.Entry, logClaims bool, decider grpc_logging.ServerPayloadLoggingDecider) grpc.UnaryServerInterceptor

func UserAgentStreamServerInterceptor added in v0.11.0

func UserAgentStreamServerInterceptor(clientName, constraintStr string) grpc.StreamServerInterceptor

UserAgentStreamServerInterceptor returns a StreamServerInterceptor which enforces a minimum client version in the user agent

func UserAgentUnaryServerInterceptor added in v0.11.0

func UserAgentUnaryServerInterceptor(clientName, constraintStr string) grpc.UnaryServerInterceptor

UserAgentUnaryServerInterceptor returns a UnaryServerInterceptor which enforces a minimum client version in the user agent

func WithTimeout added in v0.12.3

func WithTimeout(duration time.Duration) grpc.UnaryClientInterceptor

Types

type JSONMarshaler added in v1.7.0

type JSONMarshaler struct{}

JSONMarshaler is a type which satisfies the grpc-gateway Marshaler interface

func (*JSONMarshaler) ContentType added in v1.7.0

func (j *JSONMarshaler) ContentType() string

ContentType implements gwruntime.Marshaler.

func (*JSONMarshaler) Marshal added in v1.7.0

func (j *JSONMarshaler) Marshal(v interface{}) ([]byte, error)

Marshal implements gwruntime.Marshaler.

func (*JSONMarshaler) NewDecoder added in v1.7.0

func (j *JSONMarshaler) NewDecoder(r io.Reader) gwruntime.Decoder

NewDecoder implements gwruntime.Marshaler.

func (*JSONMarshaler) NewEncoder added in v1.7.0

func (j *JSONMarshaler) NewEncoder(w io.Writer) gwruntime.Encoder

NewEncoder implements gwruntime.Marshaler.

func (*JSONMarshaler) Unmarshal added in v1.7.0

func (j *JSONMarshaler) Unmarshal(data []byte, v interface{}) error

Unmarshal implements gwruntime.Marshaler.

type TLSTestResult added in v0.3.0

type TLSTestResult struct {
	TLS         bool
	InsecureErr error
}

func TestTLS added in v0.3.0

func TestTLS(address string) (*TLSTestResult, error)

Jump to

Keyboard shortcuts

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