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 full name of the called method, in the format of "package/service.method". FullMethod 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.
func SingletonByFullMethod ¶ added in v0.18.0
func SingletonByFullMethod(initFn func() Interceptor) Interceptor
SingletonByFullMethod returns an Interceptor that is a singleton for the given method.
Click to show internal directories.
Click to hide internal directories.