Versions in this module Expand all Collapse all v0 v0.7.4 Jul 26, 2026 Changes in this version type MessageBus + func NewKVMessageBus(rc kv.UniversalClient) MessageBus v0.7.3 Jul 26, 2026 Changes in this version + const DefaultAffinityShortCircuit + const DefaultAffinityTimeout + const DefaultClientTimeout + const DefaultServerTimeout + var ErrClientClosed = NewErrorf(Canceled, "client is closed") + var ErrNoResponse = NewErrorf(Unavailable, "no response from servers") + var ErrRequestCanceled = NewErrorf(Canceled, "request canceled") + var ErrRequestTimedOut = NewErrorf(DeadlineExceeded, "request timed out") + var ErrServerClosed = NewErrorf(Canceled, "server is closed") + var ErrSlowConsumer = NewErrorf(Unavailable, "stream message discarded by slow consumer") + var ErrStreamClosed = NewErrorf(Canceled, "stream closed") + var ErrStreamEOF = NewError(Unavailable, io.EOF) + var ErrUnimplemented = NewErrorf(Unimplemented, "method is not implemented") + func SetLogger(l logr.Logger) + type Channel = bus.Channel + type Claim struct + Affinity float32 + ServerID string + type ClientMultiRPCHandler interface + Close func() + Recv func(msg proto.Message, err error) + Send func(ctx context.Context, msg proto.Message, opts ...RequestOption) error + type ClientMultiRPCInterceptor func(info RPCInfo, next ClientMultiRPCHandler) ClientMultiRPCHandler + type ClientOption func(*ClientOpts) + func WithClientChannelSize(size int) ClientOption + func WithClientID(id string) ClientOption + func WithClientMultiRPCInterceptors(interceptors ...ClientMultiRPCInterceptor) ClientOption + func WithClientOptions(opts ...ClientOption) ClientOption + func WithClientRPCInterceptors(interceptors ...ClientRPCInterceptor) ClientOption + func WithClientRequestHooks(hooks ...ClientRequestHook) ClientOption + func WithClientResponseHooks(hooks ...ClientResponseHook) ClientOption + func WithClientSelectTimeout(timeout time.Duration) ClientOption + func WithClientStreamInterceptors(interceptors ...StreamInterceptor) ClientOption + func WithClientTimeout(timeout time.Duration) ClientOption + type ClientOpts struct + ChannelSize int + ClientID string + EnableStreams bool + MultiRPCInterceptors []ClientMultiRPCInterceptor + RequestHooks []ClientRequestHook + ResponseHooks []ClientResponseHook + RpcInterceptors []ClientRPCInterceptor + SelectionTimeout time.Duration + StreamInterceptors []StreamInterceptor + Timeout time.Duration + type ClientRPCHandler func(ctx context.Context, req proto.Message, opts ...RequestOption) (proto.Message, error) + type ClientRPCInterceptor func(info RPCInfo, next ClientRPCHandler) ClientRPCHandler + type ClientRequestHook func(ctx context.Context, req proto.Message, info RPCInfo) + type ClientResponseHook func(ctx context.Context, req proto.Message, info RPCInfo, res proto.Message, ...) + type ClientStream interface + type Error interface + Code func() ErrorCode + Details func() []any + DetailsProto func() []*anypb.Any + GRPCStatus func() *status.Status + ToHttp func() int + func NewError(code ErrorCode, err error, details ...proto.Message) Error + func NewErrorFromResponse(code, err string, details ...*anypb.Any) Error + func NewErrorf(code ErrorCode, msg string, args ...interface{}) Error + type ErrorCode string + const Aborted + const AlreadyExists + const Canceled + const DataLoss + const DeadlineExceeded + const FailedPrecondition + const Internal + const InvalidArgument + const MalformedRequest + const MalformedResponse + const NotAcceptable + const NotFound + const OK + const OutOfRange + const PermissionDenied + const ResourceExhausted + const Unauthenticated + const Unavailable + const Unimplemented + const Unknown + const UnprocessableEntity + const UpstreamClientError + const UpstreamServerError + func ErrorCodeFromGRPC(code codes.Code) ErrorCode + func GetErrorCode(err error) (ErrorCode, bool) + func (e ErrorCode) Error() string + func (e ErrorCode) ToGRPC() codes.Code + func (e ErrorCode) ToHTTP() int + func (e ErrorCode) ToTwirp() twirp.ErrorCode + type MessageBus bus.MessageBus + func NewLocalMessageBus() MessageBus + func NewNatsMessageBus(nc *nats.Conn) MessageBus + func NewRedisMessageBus(rc redis.UniversalClient) MessageBus + type RPCInfo struct + Method string + Multi bool + Service string + Topic []string + type RequestInterceptor interface + type RequestOption func(*RequestOpts) + func WithRequestInterceptors[T RequestInterceptor](interceptors ...T) RequestOption + func WithRequestTimeout(timeout time.Duration) RequestOption + func WithSelectionOpts(opts SelectionOpts) RequestOption + type RequestOpts struct + Interceptors []any + SelectionOpts SelectionOpts + Timeout time.Duration + type Response struct + Err error + Result ResponseType + type SelectionOpts struct + AcceptFirstAvailable bool + AffinityTimeout time.Duration + MaximumAffinity float32 + MinimumAffinity float32 + SelectionFunc func([]*Claim) (string, error) + ShortCircuitTimeout time.Duration + type ServerOption func(*ServerOpts) + func WithServerChannelSize(size int) ServerOption + func WithServerID(id string) ServerOption + func WithServerOptions(opts ...ServerOption) ServerOption + func WithServerRPCInterceptors(interceptors ...ServerRPCInterceptor) ServerOption + func WithServerStreamInterceptors(interceptors ...StreamInterceptor) ServerOption + func WithServerTimeout(timeout time.Duration) ServerOption + type ServerOpts struct + ChainedInterceptor ServerRPCInterceptor + ChannelSize int + Interceptors []ServerRPCInterceptor + ServerID string + StreamInterceptors []StreamInterceptor + Timeout time.Duration + type ServerRPCHandler func(context.Context, proto.Message) (proto.Message, error) + type ServerRPCInterceptor func(ctx context.Context, req proto.Message, info RPCInfo, handler ServerRPCHandler) (proto.Message, error) + type ServerStream interface + Hijack func() + type Stream interface + Channel func() <-chan RecvType + Close func(cause error) error + Context func() context.Context + Err func() error + Send func(msg SendType, opts ...StreamOption) error + type StreamHandler interface + Close func(cause error) error + Recv func(msg proto.Message) error + Send func(msg proto.Message, opts ...StreamOption) error + type StreamInterceptor func(info RPCInfo, next StreamHandler) StreamHandler + type StreamOption func(*StreamOpts) + func WithTimeout(timeout time.Duration) StreamOption + type StreamOpts struct + Timeout time.Duration + type Subscription bus.Subscription[MessageType]