Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 35 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Interceptor configuration functions \(AddUnaryServerInterceptor, SetFilterFunc,
- [func DefaultStreamInterceptors\(\) \[\]grpc.StreamServerInterceptor](<#DefaultStreamInterceptors>)
- [func DoHTTPtoGRPC\(ctx context.Context, svr interface\{\}, handler func\(ctx context.Context, req interface\{\}\) \(interface\{\}, error\), in interface\{\}\) \(interface\{\}, error\)](<#DoHTTPtoGRPC>)
- [func FilterMethodsFunc\(ctx context.Context, fullMethodName string\) bool](<#FilterMethodsFunc>)
- [func GRPCClientInterceptor\(options ...grpc\_opentracing.Option\) grpc.UnaryClientInterceptor](<#GRPCClientInterceptor>)
- [func GRPCClientInterceptor\(options ...interface\{\}\) grpc.UnaryClientInterceptor](<#GRPCClientInterceptor>)
- [func HystrixClientInterceptor\(defaultOpts ...grpc.CallOption\) grpc.UnaryClientInterceptor](<#HystrixClientInterceptor>)
- [func NRHttpTracer\(pattern string, h http.HandlerFunc\) \(string, http.HandlerFunc\)](<#NRHttpTracer>)
- [func NewRelicClientInterceptor\(\) grpc.UnaryClientInterceptor](<#NewRelicClientInterceptor>)
Expand Down Expand Up @@ -75,7 +75,7 @@ var (
```

<a name="AddStreamClientInterceptor"></a>
## func [AddStreamClientInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L116>)
## func [AddStreamClientInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L118>)

```go
func AddStreamClientInterceptor(ctx context.Context, i ...grpc.StreamClientInterceptor)
Expand All @@ -84,7 +84,7 @@ func AddStreamClientInterceptor(ctx context.Context, i ...grpc.StreamClientInter
AddStreamClientInterceptor adds a client stream interceptor to default client stream interceptors. Must be called during initialization, before any RPCs are made. Not safe for concurrent use.

<a name="AddStreamServerInterceptor"></a>
## func [AddStreamServerInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L97>)
## func [AddStreamServerInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L99>)

```go
func AddStreamServerInterceptor(ctx context.Context, i ...grpc.StreamServerInterceptor)
Expand All @@ -93,7 +93,7 @@ func AddStreamServerInterceptor(ctx context.Context, i ...grpc.StreamServerInter
AddStreamServerInterceptor adds a server interceptor to default server interceptors. Must be called during initialization, before the server starts. Not safe for concurrent use.

<a name="AddUnaryClientInterceptor"></a>
## func [AddUnaryClientInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L110>)
## func [AddUnaryClientInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L112>)

```go
func AddUnaryClientInterceptor(ctx context.Context, i ...grpc.UnaryClientInterceptor)
Expand All @@ -102,7 +102,7 @@ func AddUnaryClientInterceptor(ctx context.Context, i ...grpc.UnaryClientInterce
AddUnaryClientInterceptor adds a client interceptor to default client interceptors. Must be called during initialization, before any RPCs are made. Not safe for concurrent use.

<a name="AddUnaryServerInterceptor"></a>
## func [AddUnaryServerInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L91>)
## func [AddUnaryServerInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L93>)

```go
func AddUnaryServerInterceptor(ctx context.Context, i ...grpc.UnaryServerInterceptor)
Expand All @@ -111,7 +111,7 @@ func AddUnaryServerInterceptor(ctx context.Context, i ...grpc.UnaryServerInterce
AddUnaryServerInterceptor adds a server interceptor to default server interceptors. Must be called during initialization, before the server starts. Not safe for concurrent use.

<a name="DebugLoggingInterceptor"></a>
## func [DebugLoggingInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L368>)
## func [DebugLoggingInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L347>)

```go
func DebugLoggingInterceptor() grpc.UnaryServerInterceptor
Expand All @@ -120,7 +120,7 @@ func DebugLoggingInterceptor() grpc.UnaryServerInterceptor
DebugLoggingInterceptor is the interceptor that logs all request/response from a handler

<a name="DefaultClientInterceptor"></a>
## func [DefaultClientInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L358>)
## func [DefaultClientInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L337>)

```go
func DefaultClientInterceptor(defaultOpts ...interface{}) grpc.UnaryClientInterceptor
Expand All @@ -129,7 +129,7 @@ func DefaultClientInterceptor(defaultOpts ...interface{}) grpc.UnaryClientInterc
DefaultClientInterceptor are the set of default interceptors that should be applied to all client calls

<a name="DefaultClientInterceptors"></a>
## func [DefaultClientInterceptors](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L285>)
## func [DefaultClientInterceptors](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L280>)

```go
func DefaultClientInterceptors(defaultOpts ...interface{}) []grpc.UnaryClientInterceptor
Expand All @@ -138,7 +138,7 @@ func DefaultClientInterceptors(defaultOpts ...interface{}) []grpc.UnaryClientInt
DefaultClientInterceptors are the set of default interceptors that should be applied to all client calls

<a name="DefaultClientStreamInterceptor"></a>
## func [DefaultClientStreamInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L363>)
## func [DefaultClientStreamInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L342>)

```go
func DefaultClientStreamInterceptor(defaultOpts ...interface{}) grpc.StreamClientInterceptor
Expand All @@ -147,7 +147,7 @@ func DefaultClientStreamInterceptor(defaultOpts ...interface{}) grpc.StreamClien
DefaultClientStreamInterceptor are the set of default interceptors that should be applied to all stream client calls

<a name="DefaultClientStreamInterceptors"></a>
## func [DefaultClientStreamInterceptors](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L316>)
## func [DefaultClientStreamInterceptors](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L306>)

```go
func DefaultClientStreamInterceptors(defaultOpts ...interface{}) []grpc.StreamClientInterceptor
Expand All @@ -156,7 +156,7 @@ func DefaultClientStreamInterceptors(defaultOpts ...interface{}) []grpc.StreamCl
DefaultClientStreamInterceptors are the set of default interceptors that should be applied to all stream client calls

<a name="DefaultInterceptors"></a>
## func [DefaultInterceptors](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L265>)
## func [DefaultInterceptors](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L261>)

```go
func DefaultInterceptors() []grpc.UnaryServerInterceptor
Expand All @@ -165,7 +165,7 @@ func DefaultInterceptors() []grpc.UnaryServerInterceptor
DefaultInterceptors are the set of default interceptors that are applied to all coldbrew methods

<a name="DefaultStreamInterceptors"></a>
## func [DefaultStreamInterceptors](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L341>)
## func [DefaultStreamInterceptors](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L321>)

```go
func DefaultStreamInterceptors() []grpc.StreamServerInterceptor
Expand All @@ -174,7 +174,7 @@ func DefaultStreamInterceptors() []grpc.StreamServerInterceptor
DefaultStreamInterceptors are the set of default interceptors that should be applied to all coldbrew streams

<a name="DoHTTPtoGRPC"></a>
## func [DoHTTPtoGRPC](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L251>)
## func [DoHTTPtoGRPC](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L247>)

```go
func DoHTTPtoGRPC(ctx context.Context, svr interface{}, handler func(ctx context.Context, req interface{}) (interface{}, error), in interface{}) (interface{}, error)
Expand All @@ -183,7 +183,7 @@ func DoHTTPtoGRPC(ctx context.Context, svr interface{}, handler func(ctx context


<a name="FilterMethodsFunc"></a>
## func [FilterMethodsFunc](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L71>)
## func [FilterMethodsFunc](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L73>)

```go
func FilterMethodsFunc(ctx context.Context, fullMethodName string) bool
Expand All @@ -192,16 +192,16 @@ func FilterMethodsFunc(ctx context.Context, fullMethodName string) bool
FilterMethodsFunc is the default implementation of Filter function

<a name="GRPCClientInterceptor"></a>
## func [GRPCClientInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L472>)
## func [GRPCClientInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L453>)

```go
func GRPCClientInterceptor(options ...grpc_opentracing.Option) grpc.UnaryClientInterceptor
func GRPCClientInterceptor(options ...interface{}) grpc.UnaryClientInterceptor
```

GRPCClientInterceptor is the interceptor that intercepts all cleint requests and adds tracing info to them
Deprecated: GRPCClientInterceptor is no longer needed. gRPC tracing is now handled by otelgrpc.NewClientHandler stats handler configured at the client level. This function is retained for backwards compatibility but returns a no\-op interceptor.

<a name="HystrixClientInterceptor"></a>
## func [HystrixClientInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L484>)
## func [HystrixClientInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L467>)

```go
func HystrixClientInterceptor(defaultOpts ...grpc.CallOption) grpc.UnaryClientInterceptor
Expand All @@ -214,7 +214,7 @@ Note: This interceptor wraps github.com/afex/hystrix\-go which has been unmainta
The interceptor applies provided default and per\-call client options to configure Hystrix behavior \(for example the command name, disabled flag, excluded errors, and excluded gRPC status codes\). If Hystrix is disabled via options, the RPC is invoked directly. If the underlying RPC returns an error that matches any configured excluded error or whose gRPC status code matches any configured excluded code, Hystrix fallback is skipped and the RPC error is returned. Panics raised during the RPC invocation are captured and reported to the notifier before being converted into an error. If the RPC itself returns an error, that error is returned; otherwise any error produced by Hystrix is returned.

<a name="NRHttpTracer"></a>
## func [NRHttpTracer](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L578>)
## func [NRHttpTracer](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L561>)

```go
func NRHttpTracer(pattern string, h http.HandlerFunc) (string, http.HandlerFunc)
Expand All @@ -223,7 +223,7 @@ func NRHttpTracer(pattern string, h http.HandlerFunc) (string, http.HandlerFunc)
NRHttpTracer adds newrelic tracing to this http function

<a name="NewRelicClientInterceptor"></a>
## func [NewRelicClientInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L461>)
## func [NewRelicClientInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L440>)

```go
func NewRelicClientInterceptor() grpc.UnaryClientInterceptor
Expand All @@ -232,7 +232,7 @@ func NewRelicClientInterceptor() grpc.UnaryClientInterceptor
NewRelicClientInterceptor intercepts all client actions and reports them to newrelic

<a name="NewRelicInterceptor"></a>
## func [NewRelicInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L407>)
## func [NewRelicInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L386>)

```go
func NewRelicInterceptor() grpc.UnaryServerInterceptor
Expand All @@ -241,7 +241,7 @@ func NewRelicInterceptor() grpc.UnaryServerInterceptor
NewRelicInterceptor intercepts all server actions and reports them to newrelic

<a name="OptionsInterceptor"></a>
## func [OptionsInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L398>)
## func [OptionsInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L377>)

```go
func OptionsInterceptor() grpc.UnaryServerInterceptor
Expand All @@ -250,7 +250,7 @@ func OptionsInterceptor() grpc.UnaryServerInterceptor


<a name="PanicRecoveryInterceptor"></a>
## func [PanicRecoveryInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L438>)
## func [PanicRecoveryInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L417>)

```go
func PanicRecoveryInterceptor() grpc.UnaryServerInterceptor
Expand All @@ -259,7 +259,7 @@ func PanicRecoveryInterceptor() grpc.UnaryServerInterceptor


<a name="ResponseTimeLoggingInterceptor"></a>
## func [ResponseTimeLoggingInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L378>)
## func [ResponseTimeLoggingInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L357>)

```go
func ResponseTimeLoggingInterceptor(ff FilterFunc) grpc.UnaryServerInterceptor
Expand All @@ -268,7 +268,7 @@ func ResponseTimeLoggingInterceptor(ff FilterFunc) grpc.UnaryServerInterceptor
ResponseTimeLoggingInterceptor logs response time for each request on server

<a name="ResponseTimeLoggingStreamInterceptor"></a>
## func [ResponseTimeLoggingStreamInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L542>)
## func [ResponseTimeLoggingStreamInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L525>)

```go
func ResponseTimeLoggingStreamInterceptor() grpc.StreamServerInterceptor
Expand All @@ -277,7 +277,7 @@ func ResponseTimeLoggingStreamInterceptor() grpc.StreamServerInterceptor
ResponseTimeLoggingStreamInterceptor logs response time for stream RPCs.

<a name="ServerErrorInterceptor"></a>
## func [ServerErrorInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L419>)
## func [ServerErrorInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L398>)

```go
func ServerErrorInterceptor() grpc.UnaryServerInterceptor
Expand All @@ -286,7 +286,7 @@ func ServerErrorInterceptor() grpc.UnaryServerInterceptor
ServerErrorInterceptor intercepts all server actions and reports them to error notifier

<a name="ServerErrorStreamInterceptor"></a>
## func [ServerErrorStreamInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L558>)
## func [ServerErrorStreamInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L541>)

```go
func ServerErrorStreamInterceptor() grpc.StreamServerInterceptor
Expand All @@ -295,7 +295,7 @@ func ServerErrorStreamInterceptor() grpc.StreamServerInterceptor
ServerErrorStreamInterceptor intercepts server errors for stream RPCs and reports them to the error notifier.

<a name="SetClientMetricsOptions"></a>
## func [SetClientMetricsOptions](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L135>)
## func [SetClientMetricsOptions](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L137>)

```go
func SetClientMetricsOptions(opts ...grpcprom.ClientMetricsOption)
Expand All @@ -304,7 +304,7 @@ func SetClientMetricsOptions(opts ...grpcprom.ClientMetricsOption)
SetClientMetricsOptions appends gRPC client metrics options. Must be called during initialization, before the server starts. Not safe for concurrent use.

<a name="SetFilterFunc"></a>
## func [SetFilterFunc](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L83>)
## func [SetFilterFunc](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L85>)

```go
func SetFilterFunc(ctx context.Context, ff FilterFunc)
Expand All @@ -313,7 +313,7 @@ func SetFilterFunc(ctx context.Context, ff FilterFunc)
SetFilterFunc sets the default filter function to be used by interceptors. Must be called during initialization, before the server starts. Not safe for concurrent use.

<a name="SetResponseTimeLogLevel"></a>
## func [SetResponseTimeLogLevel](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L63>)
## func [SetResponseTimeLogLevel](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L65>)

```go
func SetResponseTimeLogLevel(ctx context.Context, level loggers.Level)
Expand All @@ -322,7 +322,7 @@ func SetResponseTimeLogLevel(ctx context.Context, level loggers.Level)
SetResponseTimeLogLevel sets the log level for response time logging. Default is InfoLevel. Must be called during initialization, before the server starts. Not safe for concurrent use.

<a name="SetServerMetricsOptions"></a>
## func [SetServerMetricsOptions](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L129>)
## func [SetServerMetricsOptions](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L131>)

```go
func SetServerMetricsOptions(opts ...grpcprom.ServerMetricsOption)
Expand All @@ -331,7 +331,7 @@ func SetServerMetricsOptions(opts ...grpcprom.ServerMetricsOption)
SetServerMetricsOptions appends gRPC server metrics options \(histogram, labels, namespace, etc.\). Must be called during initialization, before the server starts. Not safe for concurrent use.

<a name="TraceIdInterceptor"></a>
## func [TraceIdInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L600>)
## func [TraceIdInterceptor](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L583>)

```go
func TraceIdInterceptor() grpc.UnaryServerInterceptor
Expand All @@ -340,7 +340,7 @@ func TraceIdInterceptor() grpc.UnaryServerInterceptor
TraceIdInterceptor allows injecting trace id from request objects

<a name="UseColdBrewClientInterceptors"></a>
## func [UseColdBrewClientInterceptors](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L123>)
## func [UseColdBrewClientInterceptors](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L125>)

```go
func UseColdBrewClientInterceptors(ctx context.Context, flag bool)
Expand All @@ -349,7 +349,7 @@ func UseColdBrewClientInterceptors(ctx context.Context, flag bool)
UseColdBrewClientInterceptors allows enabling/disabling coldbrew client interceptors. When set to false, the coldbrew client interceptors will not be used. Must be called during initialization, before any RPCs are made. Not safe for concurrent use.

<a name="UseColdBrewServerInterceptors"></a>
## func [UseColdBrewServerInterceptors](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L104>)
## func [UseColdBrewServerInterceptors](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L106>)

```go
func UseColdBrewServerInterceptors(ctx context.Context, flag bool)
Expand All @@ -358,7 +358,7 @@ func UseColdBrewServerInterceptors(ctx context.Context, flag bool)
UseColdBrewServerInterceptors allows enabling/disabling coldbrew server interceptors. When set to false, the coldbrew server interceptors will not be used. Must be called during initialization, before the server starts. Not safe for concurrent use.

<a name="FilterFunc"></a>
## type [FilterFunc](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L68>)
## type [FilterFunc](<https://github.com/go-coldbrew/interceptors/blob/main/interceptors.go#L70>)

If it returns false, the given request will not be traced.
Comment thread
ankurs marked this conversation as resolved.

Expand Down
Loading
Loading