Documentation ¶
Index ¶
- Variables
- type Client
- type Config
- func (m *Config) CloneMessageVT() proto.Message
- func (m *Config) CloneVT() *Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (this *Config) EqualMessageVT(thatMsg proto.Message) bool
- func (this *Config) EqualVT(that *Config) bool
- func (x *Config) GetDrpcOpts() *drpc.DrpcOpts
- func (x *Config) GetPerServerBackoff() *backoff.Backoff
- func (x *Config) GetServerPeerIds() []string
- func (x *Config) GetSrcPeerId() string
- func (x *Config) GetTimeoutDur() string
- func (x *Config) GetTransportId() uint64
- func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Config) MarshalToVT(dAtA []byte) (int, error)
- func (m *Config) MarshalVT() (dAtA []byte, err error)
- func (c *Config) ParseServerPeerIds() ([]peer.ID, error)
- func (c *Config) ParseSrcPeerId() (peer.ID, error)
- func (c *Config) ParseTimeoutDur() (time.Duration, error)
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (m *Config) SizeVT() (n int)
- func (x *Config) String() string
- func (m *Config) UnmarshalVT(dAtA []byte) error
- func (c *Config) Validate() error
Constants ¶
This section is empty.
Variables ¶
View Source
var File_github_com_aperturerobotics_bifrost_stream_drpc_client_client_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a common drpc client implementation.
func (*Client) BuildTimeoutCtx ¶
BuildTimeoutCtx builds a context with the configured timeout.
func (*Client) ExecuteConnection ¶
func (c *Client) ExecuteConnection( ctx context.Context, protocolID protocol.ID, cb func(conn *drpcconn.Conn) (next bool, err error), ) error
ExecuteConnection attempts to contact one of the configured servers and execute the given callback, which should construct & use drpc clients.
Callback should return nextServer, err. If next=true is returned, tries another server.
type Config ¶
type Config struct { // ServerPeerIds are the static list of peer IDs to contact. ServerPeerIds []string `protobuf:"bytes,1,rep,name=server_peer_ids,json=serverPeerIds,proto3" json:"server_peer_ids,omitempty"` // PerServerBackoff is the server peer error backoff configuration. // Can be empty. PerServerBackoff *backoff.Backoff `protobuf:"bytes,2,opt,name=per_server_backoff,json=perServerBackoff,proto3" json:"per_server_backoff,omitempty"` // SrcPeerId is the source peer id to contact from. // Can be empty. SrcPeerId string `protobuf:"bytes,3,opt,name=src_peer_id,json=srcPeerId,proto3" json:"src_peer_id,omitempty"` // TransportId restricts which transport we can dial out from. TransportId uint64 `protobuf:"varint,4,opt,name=transport_id,json=transportId,proto3" json:"transport_id,omitempty"` // DrpcOpts are options passed to drpc. DrpcOpts *drpc.DrpcOpts `protobuf:"bytes,5,opt,name=drpc_opts,json=drpcOpts,proto3" json:"drpc_opts,omitempty"` // TimeoutDur sets the per-server establish timeout. // If unset, no timeout. // Example: 15s TimeoutDur string `protobuf:"bytes,6,opt,name=timeout_dur,json=timeoutDur,proto3" json:"timeout_dur,omitempty"` // contains filtered or unexported fields }
Config configures a client for a drpc service.
func (*Config) CloneMessageVT ¶ added in v0.15.6
func (*Config) Descriptor
deprecated
func (*Config) EqualMessageVT ¶ added in v0.15.6
func (*Config) GetDrpcOpts ¶
func (*Config) GetPerServerBackoff ¶
func (*Config) GetServerPeerIds ¶
func (*Config) GetSrcPeerId ¶
func (*Config) GetTimeoutDur ¶
func (*Config) GetTransportId ¶
func (*Config) MarshalToSizedBufferVT ¶ added in v0.2.0
func (*Config) ParseServerPeerIds ¶
ParseServerPeerIds parses the destination peer ids
func (*Config) ParseSrcPeerId ¶
ParseSrcPeerId parses the source peer id, if set.
func (*Config) ParseTimeoutDur ¶
ParseTimeoutDur parses the timeout duration. returns zero if empty
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶ added in v0.2.0
func (x *Config) ProtoReflect() protoreflect.Message
func (*Config) UnmarshalVT ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.