Documentation ¶
Index ¶
- func WrapRPCErr(err error) error
- type AtomicBroker
- type AtomicClient
- type Broker
- type BrokerConfig
- type BrokerExt
- func (b *BrokerExt) CloseAll(deps ...Resource)
- func (b *BrokerExt) Dial(id uint32) (conn *grpc.ClientConn, err error)
- func (b *BrokerExt) NewClientConn(name string, newClient newClientFn) *clientConn
- func (b *BrokerExt) Serve(name string, server *grpc.Server, deps ...Resource) (uint32, Resource, error)
- func (b *BrokerExt) ServeNew(name string, register func(*grpc.Server), deps ...Resource) (uint32, Resource, error)
- func (b *BrokerExt) StopCtx() (context.Context, context.CancelFunc)
- func (b *BrokerExt) WithName(name string) *BrokerExt
- type ErrConnAccept
- type ErrConnDial
- type GRPCOpts
- type Resource
- type Resources
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapRPCErr ¶
Types ¶
type AtomicBroker ¶
type AtomicBroker struct {
// contains filtered or unexported fields
}
An AtomicBroker implements Broker and is backed by a swappable *plugin.GRPCBroker.
func (*AtomicBroker) DialWithOptions ¶
func (a *AtomicBroker) DialWithOptions(id uint32, opts ...grpc.DialOption) (conn *grpc.ClientConn, err error)
func (*AtomicBroker) Load ¶
func (a *AtomicBroker) Load() Broker
func (*AtomicBroker) NextId ¶
func (a *AtomicBroker) NextId() uint32
func (*AtomicBroker) Store ¶
func (a *AtomicBroker) Store(b Broker)
type AtomicClient ¶
type AtomicClient struct {
// contains filtered or unexported fields
}
An AtomicClient implements grpc.ClientConnInterface and is backed by a swappable *grpc.ClientConn.
func (*AtomicClient) Invoke ¶
func (a *AtomicClient) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) error
func (*AtomicClient) NewStream ¶
func (a *AtomicClient) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)
func (*AtomicClient) Store ¶
func (a *AtomicClient) Store(cc *grpc.ClientConn)
type Broker ¶
type Broker interface { Accept(id uint32) (net.Listener, error) DialWithOptions(id uint32, opts ...grpc.DialOption) (conn *grpc.ClientConn, err error) NextId() uint32 }
Broker is a subset of the methods exported by *plugin.GRPCBroker.
type BrokerConfig ¶
BrokerConfig holds Broker configuration fields.
type BrokerExt ¶
type BrokerExt struct { Broker Broker BrokerConfig }
BrokerExt extends a Broker with various helper methods.
func (*BrokerExt) NewClientConn ¶
NewClientConn return a new *clientConn backed by this *BrokerExt.
type ErrConnAccept ¶
func (ErrConnAccept) Error ¶
func (e ErrConnAccept) Error() string
func (ErrConnAccept) Unwrap ¶
func (e ErrConnAccept) Unwrap() error
type ErrConnDial ¶
func (ErrConnDial) Error ¶
func (e ErrConnDial) Error() string
func (ErrConnDial) Unwrap ¶
func (e ErrConnDial) Unwrap() error
type GRPCOpts ¶
type GRPCOpts struct { // Optionally include additional options when dialing a client. // Normally aligned with [plugin.ClientConfig.GRPCDialOptions]. DialOpts []grpc.DialOption // Optionally override the default *grpc.Server constructor. // Normally aligned with [plugin.ServeConfig.GRPCServer]. NewServer func([]grpc.ServerOption) *grpc.Server }
GRPCOpts has GRPC client and server options.
Click to show internal directories.
Click to hide internal directories.