Documentation
¶
Index ¶
- Constants
- Variables
- func GetVersionHeaderClientUnaryInterceptor(ctx context.Context, method string, req, reply interface{}, ...) error
- func IncomingHeaderMatcher(key string) (string, bool)
- func LoggerStreamServerInterceptor(logger logging.Logger) grpc.StreamServerInterceptor
- func LoggerUnaryServerInterceptor(logger logging.Logger) grpc.UnaryServerInterceptor
- func NewMuxHandler(grpcServerHandler http.Handler, httpServerHandler http.Handler) http.Handler
- func PanicLoggerStreamServerInterceptor(log logging.Logger) grpc.StreamServerInterceptor
- func PanicLoggerUnaryServerInterceptor(log logging.Logger) grpc.UnaryServerInterceptor
- func RatelimitStreamServerInterceptor(ratelimiter limiter.Store) grpc.StreamServerInterceptor
- func RatelimitUnaryServerInterceptor(ratelimiter limiter.Store) grpc.UnaryServerInterceptor
- func SetVersionHeaderStreamServerInterceptor(version wfv1.Version) grpc.StreamServerInterceptor
- func SetVersionHeaderUnaryServerInterceptor(version wfv1.Version) grpc.UnaryServerInterceptor
- func TranslateError(err error) error
Constants ¶
const (
ArgoVersionHeader = "argo-version"
)
Variables ¶
var ( LastSeenServerVersion string ErrorTranslationUnaryServerInterceptor = func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { resp, err = handler(ctx, req) return resp, TranslateError(err) } ErrorTranslationStreamServerInterceptor = func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { return TranslateError(handler(srv, ss)) } )
Functions ¶
func GetVersionHeaderClientUnaryInterceptor ¶
func GetVersionHeaderClientUnaryInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
GetVersionHeaderClientUnaryInterceptor returns a new unary client interceptor that extracts the argo-version from the response and sets the global variable LastSeenServerVersion
func IncomingHeaderMatcher ¶
func LoggerStreamServerInterceptor ¶
func LoggerStreamServerInterceptor(logger logging.Logger) grpc.StreamServerInterceptor
LoggerStreamServerInterceptor adds a logger to the context for streaming requests
func LoggerUnaryServerInterceptor ¶
func LoggerUnaryServerInterceptor(logger logging.Logger) grpc.UnaryServerInterceptor
LoggerUnaryServerInterceptor adds a logger to the context
func NewMuxHandler ¶
NewMuxHandler returns an HTTP handler that allows serving both gRPC and HTTP requests over the same port, both with and without TLS enabled. It dispatches HTTP/2 requests with a gRPC content type to the gRPC handler and forwards all other requests to the HTTP handler. Unencrypted HTTP/2 (h2c) support is enabled by the serving http.Server via its Protocols field; see the call site in the Argo server.
func PanicLoggerStreamServerInterceptor ¶
func PanicLoggerStreamServerInterceptor(log logging.Logger) grpc.StreamServerInterceptor
PanicLoggerStreamServerInterceptor returns a new streaming server interceptor for recovering from panics and returning error
func PanicLoggerUnaryServerInterceptor ¶
func PanicLoggerUnaryServerInterceptor(log logging.Logger) grpc.UnaryServerInterceptor
PanicLoggerUnaryServerInterceptor returns a new unary server interceptor for recovering from panics and returning error
func RatelimitStreamServerInterceptor ¶
func RatelimitStreamServerInterceptor(ratelimiter limiter.Store) grpc.StreamServerInterceptor
RatelimitStreamServerInterceptor returns a new stream server interceptor that performs rate limiting on the request.
func RatelimitUnaryServerInterceptor ¶
func RatelimitUnaryServerInterceptor(ratelimiter limiter.Store) grpc.UnaryServerInterceptor
RatelimitUnaryServerInterceptor returns a new unary server interceptor that performs request rate limiting.
func SetVersionHeaderStreamServerInterceptor ¶
func SetVersionHeaderStreamServerInterceptor(version wfv1.Version) grpc.StreamServerInterceptor
SetVersionHeaderStreamServerInterceptor returns a new stream server interceptor that sets the argo-version header
func SetVersionHeaderUnaryServerInterceptor ¶
func SetVersionHeaderUnaryServerInterceptor(version wfv1.Version) grpc.UnaryServerInterceptor
SetVersionHeaderUnaryServerInterceptor returns a new unary server interceptor that sets the argo-version header
func TranslateError ¶
translate a K8S errors into gRPC error - assume that we want to surface this - which we may not
Types ¶
This section is empty.