Documentation
¶
Index ¶
- func BlockingNewClient(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 InterceptorLogger(l logrus.FieldLogger) logging.Logger
- func LoggerRecoveryHandler(log *logrus.Entry) recovery.RecoveryHandlerFunc
- func MustMarshal(v any) []byte
- func NewSanitizer() *sanitizer
- func PayloadStreamServerInterceptor(entry *logrus.Entry, logClaims bool, ...) grpc.StreamServerInterceptor
- func PayloadUnaryServerInterceptor(entry *logrus.Entry, logClaims bool, ...) grpc.UnaryServerInterceptor
- func RetryOnlyForServerStreamInterceptor(retryOpts ...grpc_retry.CallOption) grpc.StreamClientInterceptor
- func UnwrapGRPCStatus(err error) *status.Status
- func UserAgentStreamServerInterceptor(clientName, constraintStr string) grpc.StreamServerInterceptor
- func UserAgentUnaryServerInterceptor(clientName, constraintStr string) grpc.UnaryServerInterceptor
- type JSONMarshaler
- type Sanitizer
- type TLSTestResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlockingNewClient ¶ added in v1.8.8
func BlockingNewClient(ctx context.Context, network, address string, creds credentials.TransportCredentials, opts ...grpc.DialOption) (*grpc.ClientConn, error)
BlockingNewClient 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 v1.8.8
ContextWithSanitizer returns a new context with sanitizer set.
func ErrorCodeGitStreamServerInterceptor ¶ added in v1.8.8
func ErrorCodeGitStreamServerInterceptor() grpc.StreamServerInterceptor
ErrorCodeGitStreamServerInterceptor replaces Kubernetes errors with relevant gRPC equivalents, if any.
func ErrorCodeGitUnaryServerInterceptor ¶ added in v1.8.8
func ErrorCodeGitUnaryServerInterceptor() grpc.UnaryServerInterceptor
ErrorCodeGitUnaryServerInterceptor replaces Kubernetes errors with relevant gRPC equivalents, if any.
func ErrorCodeK8sStreamServerInterceptor ¶ added in v1.8.8
func ErrorCodeK8sStreamServerInterceptor() grpc.StreamServerInterceptor
ErrorCodeK8sStreamServerInterceptor replaces Kubernetes errors with relevant gRPC equivalents, if any.
func ErrorCodeK8sUnaryServerInterceptor ¶ added in v1.8.8
func ErrorCodeK8sUnaryServerInterceptor() grpc.UnaryServerInterceptor
ErrorCodeK8sUnaryServerInterceptor replaces Kubernetes errors with relevant gRPC equivalents, if any.
func ErrorSanitizerUnaryServerInterceptor ¶ added in v1.8.8
func ErrorSanitizerUnaryServerInterceptor() grpc.UnaryServerInterceptor
ErrorSanitizerUnaryServerInterceptor returns a new unary server interceptor that sanitizes error messages and provides Sanitizer to define replacements.
func InterceptorLogger ¶ added in v1.8.8
func InterceptorLogger(l logrus.FieldLogger) logging.Logger
InterceptorLogger adapts logrus logger to interceptor logger.
func LoggerRecoveryHandler ¶ added in v1.8.8
func LoggerRecoveryHandler(log *logrus.Entry) recovery.RecoveryHandlerFunc
LoggerRecoveryHandler return a handler for recovering from panics and returning error
func MustMarshal ¶ added in v1.8.8
MustMarshal is a convenience function to marshal an object successfully or panic
func NewSanitizer ¶ added in v1.8.8
func NewSanitizer() *sanitizer
NewSanitizer returns a new Sanitizer instance
func PayloadStreamServerInterceptor ¶ added in v0.7.0
func PayloadStreamServerInterceptor(entry *logrus.Entry, logClaims bool, decider func(context.Context, interceptors.CallMeta) bool) grpc.StreamServerInterceptor
func PayloadUnaryServerInterceptor ¶ added in v0.7.0
func PayloadUnaryServerInterceptor(entry *logrus.Entry, logClaims bool, decider func(context.Context, interceptors.CallMeta) bool) grpc.UnaryServerInterceptor
func RetryOnlyForServerStreamInterceptor ¶ added in v1.8.8
func RetryOnlyForServerStreamInterceptor(retryOpts ...grpc_retry.CallOption) grpc.StreamClientInterceptor
func UnwrapGRPCStatus ¶ added in v1.8.8
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 ¶ 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
Types ¶
type JSONMarshaler ¶ added in v1.8.8
type JSONMarshaler struct{}
JSONMarshaler is a type which satisfies the grpc-gateway Marshaler interface
func (*JSONMarshaler) ContentType ¶ added in v1.8.8
func (j *JSONMarshaler) ContentType() string
ContentType implements gwruntime.Marshaler.
func (*JSONMarshaler) Marshal ¶ added in v1.8.8
func (j *JSONMarshaler) Marshal(v any) ([]byte, error)
Marshal implements gwruntime.Marshaler.
func (*JSONMarshaler) NewDecoder ¶ added in v1.8.8
func (j *JSONMarshaler) NewDecoder(r io.Reader) gwruntime.Decoder
NewDecoder implements gwruntime.Marshaler.
func (*JSONMarshaler) NewEncoder ¶ added in v1.8.8
func (j *JSONMarshaler) NewEncoder(w io.Writer) gwruntime.Encoder
NewEncoder implements gwruntime.Marshaler.