Documentation ¶
Index ¶
- func BlockingDial(ctx context.Context, network, address string, ...) (*grpc.ClientConn, error)
- func ContextWithSanitizer(ctx context.Context, sanitizer Sanitizer) context.Context
- func ErrorCodeGitStreamServerInterceptor() grpc.StreamServerInterceptor
- func ErrorCodeGitUnaryServerInterceptor() grpc.UnaryServerInterceptor
- func ErrorCodeK8sStreamServerInterceptor() grpc.StreamServerInterceptor
- func ErrorCodeK8sUnaryServerInterceptor() grpc.UnaryServerInterceptor
- func ErrorSanitizerUnaryServerInterceptor() grpc.UnaryServerInterceptor
- func MustMarshal(v interface{}) []byte
- func NewSanitizer() *sanitizer
- func OTELStreamClientInterceptor() grpc.StreamClientInterceptor
- func OTELUnaryClientInterceptor() grpc.UnaryClientInterceptor
- func PanicLoggerStreamServerInterceptor(log *logrus.Entry) grpc.StreamServerInterceptor
- func PanicLoggerUnaryServerInterceptor(log *logrus.Entry) grpc.UnaryServerInterceptor
- func PayloadStreamServerInterceptor(entry *logrus.Entry, logClaims bool, ...) grpc.StreamServerInterceptor
- func PayloadUnaryServerInterceptor(entry *logrus.Entry, logClaims bool, ...) grpc.UnaryServerInterceptor
- func UnwrapGRPCStatus(err error) *status.Status
- func UserAgentStreamServerInterceptor(clientName, constraintStr string) grpc.StreamServerInterceptor
- func UserAgentUnaryServerInterceptor(clientName, constraintStr string) grpc.UnaryServerInterceptor
- func WithTimeout(duration time.Duration) grpc.UnaryClientInterceptor
- type JSONMarshaler
- func (j *JSONMarshaler) ContentType() string
- func (j *JSONMarshaler) Marshal(v interface{}) ([]byte, error)
- func (j *JSONMarshaler) NewDecoder(r io.Reader) gwruntime.Decoder
- func (j *JSONMarshaler) NewEncoder(w io.Writer) gwruntime.Encoder
- func (j *JSONMarshaler) Unmarshal(data []byte, v interface{}) error
- type Sanitizer
- type TLSTestResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockingDial ¶
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 ContextWithSanitizer ¶ added in v2.3.0
ContextWithSanitizer returns a new context with sanitizer set.
func ErrorCodeGitStreamServerInterceptor ¶ added in v2.2.0
func ErrorCodeGitStreamServerInterceptor() grpc.StreamServerInterceptor
ErrorCodeGitStreamServerInterceptor replaces Kubernetes errors with relevant gRPC equivalents, if any.
func ErrorCodeGitUnaryServerInterceptor ¶ added in v2.2.0
func ErrorCodeGitUnaryServerInterceptor() grpc.UnaryServerInterceptor
ErrorCodeGitUnaryServerInterceptor replaces Kubernetes errors with relevant gRPC equivalents, if any.
func ErrorCodeK8sStreamServerInterceptor ¶ added in v2.2.0
func ErrorCodeK8sStreamServerInterceptor() grpc.StreamServerInterceptor
ErrorCodeK8sStreamServerInterceptor replaces Kubernetes errors with relevant gRPC equivalents, if any.
func ErrorCodeK8sUnaryServerInterceptor ¶ added in v2.2.0
func ErrorCodeK8sUnaryServerInterceptor() grpc.UnaryServerInterceptor
ErrorCodeK8sUnaryServerInterceptor replaces Kubernetes errors with relevant gRPC equivalents, if any.
func ErrorSanitizerUnaryServerInterceptor ¶ added in v2.3.0
func ErrorSanitizerUnaryServerInterceptor() grpc.UnaryServerInterceptor
ErrorSanitizerUnaryServerInterceptor returns a new unary server interceptor that sanitizes error messages and provides Sanitizer to define replacements.
func MustMarshal ¶
func MustMarshal(v interface{}) []byte
MustMarshal is a convenience function to marshal an object successfully or panic
func NewSanitizer ¶ added in v2.3.0
func NewSanitizer() *sanitizer
NewSanitizer returns a new Sanitizer instance
func OTELStreamClientInterceptor ¶ added in v2.8.2
func OTELStreamClientInterceptor() grpc.StreamClientInterceptor
func OTELUnaryClientInterceptor ¶ added in v2.8.2
func OTELUnaryClientInterceptor() grpc.UnaryClientInterceptor
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 ¶
func PayloadStreamServerInterceptor(entry *logrus.Entry, logClaims bool, decider grpc_logging.ServerPayloadLoggingDecider) grpc.StreamServerInterceptor
func PayloadUnaryServerInterceptor ¶
func PayloadUnaryServerInterceptor(entry *logrus.Entry, logClaims bool, decider grpc_logging.ServerPayloadLoggingDecider) grpc.UnaryServerInterceptor
func UnwrapGRPCStatus ¶ added in v2.4.0
UnwrapGRPCStatus will attempt to cast the given error into a grpc Status object unwrapping all existing inner errors. Will return nil if none of the nested errors can be casted.
func UserAgentStreamServerInterceptor ¶
func UserAgentStreamServerInterceptor(clientName, constraintStr string) grpc.StreamServerInterceptor
UserAgentStreamServerInterceptor returns a StreamServerInterceptor which enforces a minimum client version in the user agent
func UserAgentUnaryServerInterceptor ¶
func UserAgentUnaryServerInterceptor(clientName, constraintStr string) grpc.UnaryServerInterceptor
UserAgentUnaryServerInterceptor returns a UnaryServerInterceptor which enforces a minimum client version in the user agent
func WithTimeout ¶
func WithTimeout(duration time.Duration) grpc.UnaryClientInterceptor
Types ¶
type JSONMarshaler ¶
type JSONMarshaler struct{}
JSONMarshaler is a type which satisfies the grpc-gateway Marshaler interface
func (*JSONMarshaler) ContentType ¶
func (j *JSONMarshaler) ContentType() string
ContentType implements gwruntime.Marshaler.
func (*JSONMarshaler) Marshal ¶
func (j *JSONMarshaler) Marshal(v interface{}) ([]byte, error)
Marshal implements gwruntime.Marshaler.
func (*JSONMarshaler) NewDecoder ¶
func (j *JSONMarshaler) NewDecoder(r io.Reader) gwruntime.Decoder
NewDecoder implements gwruntime.Marshaler.
func (*JSONMarshaler) NewEncoder ¶
func (j *JSONMarshaler) NewEncoder(w io.Writer) gwruntime.Encoder
NewEncoder implements gwruntime.Marshaler.
func (*JSONMarshaler) Unmarshal ¶
func (j *JSONMarshaler) Unmarshal(data []byte, v interface{}) error
Unmarshal implements gwruntime.Marshaler.