Documentation
¶
Index ¶
- Constants
- func ClientIPFromContext(ctx context.Context) string
- func GRPCUnaryServerInterceptor() grpc.UnaryServerInterceptor
- func HTTPMiddleware(next http.Handler) http.Handler
- func MustLoad(ctx context.Context, key any) (value any, ok bool)
- func MustSetHeader(ctx context.Context, key, value string)
- func MustStore(ctx context.Context, key, value any)
- func UnaryConnectInterceptor[T any](svc T) connect.UnaryInterceptorFunc
- func UnaryServerInterceptor(defClientKind ClientKind) grpc.UnaryServerInterceptordeprecated
- type CallMeta
- type ClientKinddeprecated
- type HTTPMeta
Constants ¶
View Source
const HeaderEnsureClientKind = "x-ensure-client-kind"
HeaderEnsureClientKind is just used for reverse proxy such as grpc-gateway
Variables ¶
This section is empty.
Functions ¶
func ClientIPFromContext ¶
func GRPCUnaryServerInterceptor ¶ added in v3.3.0
func GRPCUnaryServerInterceptor() grpc.UnaryServerInterceptor
GRPCUnaryServerInterceptor is a unary server interceptor for gRPC
func MustSetHeader ¶
func UnaryConnectInterceptor ¶
func UnaryConnectInterceptor[T any](svc T) connect.UnaryInterceptorFunc
func UnaryServerInterceptor
deprecated
func UnaryServerInterceptor(defClientKind ClientKind) grpc.UnaryServerInterceptor
Deprecated: use GRPCUnaryServerInterceptor instead
Types ¶
type CallMeta ¶
type CallMeta struct {
ClientKind ClientKind
Service any
FullMethod string
Req any
}
func CallMetaFromContext ¶ added in v3.3.0
func MustCallMetaFromContext ¶
type ClientKind
deprecated
type ClientKind string
Deprecated: use ClientKindUndefined instead
const ( ClientKindPublic ClientKind = "PUBLIC" ClientKindPrivate ClientKind = "PRIVATE" ClientKindUndefined ClientKind = "UNDEFINED" )
func (ClientKind) IsPrivate ¶
func (k ClientKind) IsPrivate() bool
type HTTPMeta ¶
type HTTPMeta struct {
ClientKind ClientKind
R *http.Request
W http.ResponseWriter
}
func HTTPMetaFromContext ¶ added in v3.3.0
func MustHTTPMetaFromContext ¶
Click to show internal directories.
Click to hide internal directories.