Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallInfo ¶ added in v0.6.0
type CallInfo struct { // The impl of the called component. Impl any // The component name of the called method. Component string // The full name of the called method, in the format of "package/service.method". FullMethod string // The name of the method. Method string }
CallInfo contains information about the call.
type Condition ¶
Condition is the type of the function used to determine whether an interceptor should be used.
type HandleFunc ¶ added in v0.6.0
HandleFunc is the type of the function invoked by Components.
type Interceptor ¶ added in v0.6.0
type Interceptor func(ctx context.Context, info CallInfo, req, reply []any, invoker HandleFunc) error
Interceptor is the type of the function used to intercept Components.
func Chain ¶
func Chain(interceptors []Interceptor) Interceptor
Chain converts a slice of Interceptors into a single Interceptor.
func If ¶
func If(interceptor Interceptor, condition Condition) Interceptor
If returns an Interceptor that only invokes the given interceptor if the given condition is true.
Click to show internal directories.
Click to hide internal directories.