Documentation
¶
Overview ¶
Package interceptors provides the interceptors for RPC.
Index ¶
- Constants
- Variables
- type AdminAuthInterceptor
- func (i *AdminAuthInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
- func (i *AdminAuthInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
- func (i *AdminAuthInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
- type ContextInterceptor
- func (i *ContextInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
- func (i *ContextInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
- func (i *ContextInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
- type DefaultInterceptor
- func (i *DefaultInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
- func (i *DefaultInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
- func (i *DefaultInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc
Constants ¶
const ( // SlowThreshold is the threshold for slow RPC. SlowThreshold = 100 * gotime.Millisecond )
Variables ¶
var ErrUnauthenticated = errors.New("authorization is not provided")
ErrUnauthenticated is returned when authentication is failed.
Functions ¶
This section is empty.
Types ¶
type AdminAuthInterceptor ¶ added in v0.4.0
type AdminAuthInterceptor struct {
// contains filtered or unexported fields
}
AdminAuthInterceptor is an interceptor for authentication.
func NewAdminAuthInterceptor ¶ added in v0.4.0
func NewAdminAuthInterceptor(be *backend.Backend, tokenManager *auth.TokenManager) *AdminAuthInterceptor
NewAdminAuthInterceptor creates a new instance of AdminAuthInterceptor.
func (*AdminAuthInterceptor) WrapStreamingClient ¶ added in v0.4.11
func (i *AdminAuthInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
WrapStreamingClient creates a stream client interceptor for authentication.
func (*AdminAuthInterceptor) WrapStreamingHandler ¶ added in v0.4.11
func (i *AdminAuthInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
WrapStreamingHandler creates a stream server interceptor for authentication.
type ContextInterceptor ¶
type ContextInterceptor struct {
// contains filtered or unexported fields
}
ContextInterceptor is an interceptor for building additional context.
func NewContextInterceptor ¶
func NewContextInterceptor(be *backend.Backend) *ContextInterceptor
NewContextInterceptor creates a new instance of ContextInterceptor.
func (*ContextInterceptor) WrapStreamingClient ¶ added in v0.4.11
func (i *ContextInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
WrapStreamingClient creates a stream client interceptor for building additional context.
func (*ContextInterceptor) WrapStreamingHandler ¶ added in v0.4.11
func (i *ContextInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
WrapStreamingHandler creates a stream server interceptor for building additional context.
type DefaultInterceptor ¶
type DefaultInterceptor struct{}
DefaultInterceptor is a interceptor for default.
func NewDefaultInterceptor ¶
func NewDefaultInterceptor() *DefaultInterceptor
NewDefaultInterceptor creates a new instance of DefaultInterceptor.
func (*DefaultInterceptor) WrapStreamingClient ¶ added in v0.4.11
func (i *DefaultInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
WrapStreamingClient creates a stream client interceptor for default.
func (*DefaultInterceptor) WrapStreamingHandler ¶ added in v0.4.11
func (i *DefaultInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
WrapStreamingHandler creates a stream server interceptor for default.