Documentation ¶
Index ¶
- func NewRPCRetryInterceptor(opt RetryOptions) psrpc.ClientRPCInterceptor
- func NewStreamRetryInterceptor(opt RetryOptions) psrpc.StreamInterceptor
- func WithClientMetrics(observer MetricsObserver) psrpc.ClientOption
- func WithRPCRetries(opt RetryOptions) psrpc.ClientOption
- func WithServerMetrics(observer MetricsObserver) psrpc.ServerOption
- func WithServerRecovery() psrpc.ServerRPCInterceptor
- func WithStreamRetries(opt RetryOptions) psrpc.ClientOption
- type MetricRole
- type MetricsObserver
- type RetryOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRPCRetryInterceptor ¶
func NewRPCRetryInterceptor(opt RetryOptions) psrpc.ClientRPCInterceptor
func NewStreamRetryInterceptor ¶
func NewStreamRetryInterceptor(opt RetryOptions) psrpc.StreamInterceptor
func WithClientMetrics ¶
func WithClientMetrics(observer MetricsObserver) psrpc.ClientOption
func WithRPCRetries ¶
func WithRPCRetries(opt RetryOptions) psrpc.ClientOption
func WithServerMetrics ¶
func WithServerMetrics(observer MetricsObserver) psrpc.ServerOption
func WithServerRecovery ¶
func WithServerRecovery() psrpc.ServerRPCInterceptor
Recover from server panics. Should always be the last interceptor
func WithStreamRetries ¶
func WithStreamRetries(opt RetryOptions) psrpc.ClientOption
Types ¶
type MetricRole ¶
type MetricRole int
const ( ClientRole MetricRole ServerRole )
func (MetricRole) String ¶
func (r MetricRole) String() string
type MetricsObserver ¶
type MetricsObserver interface { OnUnaryRequest(role MetricRole, rpcInfo psrpc.RPCInfo, duration time.Duration, err error, rxBytes, txBytes int) OnMultiRequest(role MetricRole, rpcInfo psrpc.RPCInfo, duration time.Duration, responseCount, errorCount, rxBytes, txBytes int) OnStreamSend(role MetricRole, rpcInfo psrpc.RPCInfo, duration time.Duration, err error, bytes int) OnStreamRecv(role MetricRole, rpcInfo psrpc.RPCInfo, err error, bytes int) OnStreamOpen(role MetricRole, rpcInfo psrpc.RPCInfo) OnStreamClose(role MetricRole, rpcInfo psrpc.RPCInfo) }
type RetryOptions ¶
Click to show internal directories.
Click to hide internal directories.