Documentation
¶
Overview ¶
Package rpc provides RPC server and clients specific to Cockroach.
Index ¶
- Constants
- func Send(opts Options, method string, addrs []net.Addr, ...) ([]interface{}, error)
- type Client
- type ClusterOffsetInterval
- type Context
- type HeartbeatService
- type MajorityIntervalNotFoundError
- type ManualHeartbeatService
- type Options
- type OrderingPolicy
- type RemoteClockMonitor
- type SendError
- type Server
Constants ¶
View Source
const ( // OrderStable uses endpoints in the order provided. OrderStable = iota // OrderRandom randomly orders available endpoints. OrderRandom )
Variables ¶
This section is empty.
Functions ¶
func Send ¶
func Send(opts Options, method string, addrs []net.Addr, getArgs func(addr net.Addr) interface{}, getReply func() interface{}, context *Context) ([]interface{}, error)
Send sends one or more method RPCs to clients specified by the slice of endpoint addrs. Arguments for methods are obtained using the supplied getArgs function. The number of required replies is given by opts.N. Reply structs are obtained through the getReply() function. On success, Send returns a slice of replies of length opts.N. Otherwise, Send returns an error if and as soon as the number of failed RPCs exceeds the available endpoints less the number of required replies.