Documentation ¶
Index ¶
- Variables
- func RegisterClientServer(srv *gorums.Server, impl Client)
- type AsyncEmpty
- type Batch
- type BenchmarkData
- func (*BenchmarkData) Descriptor() ([]byte, []int)deprecated
- func (x *BenchmarkData) GetLatencyVariance() float64
- func (x *BenchmarkData) GetMeasuredLatency() float64
- func (x *BenchmarkData) GetMeasuredThroughput() float64
- func (x *BenchmarkData) GetStats() []*CommandStats
- func (*BenchmarkData) ProtoMessage()
- func (x *BenchmarkData) ProtoReflect() protoreflect.Message
- func (x *BenchmarkData) Reset()
- func (x *BenchmarkData) String() string
- type Client
- type Command
- func (*Command) Descriptor() ([]byte, []int)deprecated
- func (x *Command) GetClientID() uint32
- func (x *Command) GetData() []byte
- func (x *Command) GetSequenceNumber() uint64
- func (*Command) ProtoMessage()
- func (x *Command) ProtoReflect() protoreflect.Message
- func (x *Command) Reset()
- func (x *Command) String() string
- type CommandStats
- func (*CommandStats) Descriptor() ([]byte, []int)deprecated
- func (x *CommandStats) GetDuration() *durationpb.Duration
- func (x *CommandStats) GetStartTime() *timestamppb.Timestamp
- func (*CommandStats) ProtoMessage()
- func (x *CommandStats) ProtoReflect() protoreflect.Message
- func (x *CommandStats) Reset()
- func (x *CommandStats) String() string
- type Configuration
- type Manager
- type Node
- type QuorumSpec
Constants ¶
This section is empty.
Variables ¶
var File_client_client_proto protoreflect.FileDescriptor
Functions ¶
func RegisterClientServer ¶ added in v0.2.0
Types ¶
type AsyncEmpty ¶ added in v0.2.0
AsyncEmpty is a async object for processing replies.
type Batch ¶ added in v0.2.0
type Batch struct { Commands []*Command `protobuf:"bytes,1,rep,name=Commands,proto3" json:"Commands,omitempty"` // contains filtered or unexported fields }
Batch is a list of commands to be executed
func (*Batch) Descriptor
deprecated
added in
v0.2.0
func (*Batch) GetCommands ¶ added in v0.2.0
func (*Batch) ProtoMessage ¶ added in v0.2.0
func (*Batch) ProtoMessage()
func (*Batch) ProtoReflect ¶ added in v0.2.0
func (x *Batch) ProtoReflect() protoreflect.Message
type BenchmarkData ¶
type BenchmarkData struct { MeasuredThroughput float64 `protobuf:"fixed64,1,opt,name=MeasuredThroughput,proto3" json:"MeasuredThroughput,omitempty"` // ops/sec MeasuredLatency float64 `protobuf:"fixed64,2,opt,name=MeasuredLatency,proto3" json:"MeasuredLatency,omitempty"` // ms LatencyVariance float64 `protobuf:"fixed64,3,opt,name=LatencyVariance,proto3" json:"LatencyVariance,omitempty"` // ms^2 Stats []*CommandStats `protobuf:"bytes,4,rep,name=Stats,proto3" json:"Stats,omitempty"` // contains filtered or unexported fields }
BenchmarkData contains the throughput (in ops/sec) and latency (in ms) as measured by the client, as well as the time and duration information for each command.
func (*BenchmarkData) Descriptor
deprecated
func (*BenchmarkData) Descriptor() ([]byte, []int)
Deprecated: Use BenchmarkData.ProtoReflect.Descriptor instead.
func (*BenchmarkData) GetLatencyVariance ¶
func (x *BenchmarkData) GetLatencyVariance() float64
func (*BenchmarkData) GetMeasuredLatency ¶
func (x *BenchmarkData) GetMeasuredLatency() float64
func (*BenchmarkData) GetMeasuredThroughput ¶
func (x *BenchmarkData) GetMeasuredThroughput() float64
func (*BenchmarkData) GetStats ¶
func (x *BenchmarkData) GetStats() []*CommandStats
func (*BenchmarkData) ProtoMessage ¶
func (*BenchmarkData) ProtoMessage()
func (*BenchmarkData) ProtoReflect ¶
func (x *BenchmarkData) ProtoReflect() protoreflect.Message
func (*BenchmarkData) Reset ¶
func (x *BenchmarkData) Reset()
func (*BenchmarkData) String ¶
func (x *BenchmarkData) String() string
type Command ¶
type Command struct { ClientID uint32 `protobuf:"varint,1,opt,name=ClientID,proto3" json:"ClientID,omitempty"` SequenceNumber uint64 `protobuf:"varint,2,opt,name=SequenceNumber,proto3" json:"SequenceNumber,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data,omitempty"` // contains filtered or unexported fields }
Command is the request that is sent to the HotStuff replicas with the data to be executed.
func (*Command) Descriptor
deprecated
func (*Command) GetClientID ¶
func (*Command) GetSequenceNumber ¶
func (*Command) ProtoMessage ¶
func (*Command) ProtoMessage()
func (*Command) ProtoReflect ¶
func (x *Command) ProtoReflect() protoreflect.Message
type CommandStats ¶
type CommandStats struct { StartTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=StartTime,proto3" json:"StartTime,omitempty"` Duration *durationpb.Duration `protobuf:"bytes,2,opt,name=Duration,proto3" json:"Duration,omitempty"` // contains filtered or unexported fields }
CommandStats contains the start time and duration that elapsed before a command was executed.
func (*CommandStats) Descriptor
deprecated
func (*CommandStats) Descriptor() ([]byte, []int)
Deprecated: Use CommandStats.ProtoReflect.Descriptor instead.
func (*CommandStats) GetDuration ¶
func (x *CommandStats) GetDuration() *durationpb.Duration
func (*CommandStats) GetStartTime ¶
func (x *CommandStats) GetStartTime() *timestamppb.Timestamp
func (*CommandStats) ProtoMessage ¶
func (*CommandStats) ProtoMessage()
func (*CommandStats) ProtoReflect ¶
func (x *CommandStats) ProtoReflect() protoreflect.Message
func (*CommandStats) Reset ¶
func (x *CommandStats) Reset()
func (*CommandStats) String ¶
func (x *CommandStats) String() string
type Configuration ¶
type Configuration struct { gorums.Configuration // contains filtered or unexported fields }
A Configuration represents a static set of nodes on which quorum remote procedure calls may be invoked.
func (*Configuration) ExecCommand ¶
func (c *Configuration) ExecCommand(ctx context.Context, in *Command) *AsyncEmpty
ExecCommand sends a command to all replicas and waits for valid signatures from f+1 replicas
func (*Configuration) Nodes ¶
func (c *Configuration) Nodes() []*Node
Nodes returns a slice of each available node. IDs are returned in the same order as they were provided in the creation of the Manager.
type Manager ¶
Manager maintains a connection pool of nodes on which quorum calls can be performed.
func NewManager ¶
func NewManager(opts ...gorums.ManagerOption) (mgr *Manager)
NewManager returns a new Manager for managing connection to nodes added to the manager. This function accepts manager options used to configure various aspects of the manager.
func (*Manager) NewConfiguration ¶
func (m *Manager) NewConfiguration(qspec QuorumSpec, opts ...gorums.ConfigOption) (c *Configuration, err error)
NewConfiguration returns a configuration based on the provided list of nodes. Nodes can be supplied using WithNodeMap or WithNodeList or WithNodeIDs.
type QuorumSpec ¶
type QuorumSpec interface { // ExecCommandQF is the quorum function for the ExecCommand // asynchronous quorum call method. The in parameter is the request object // supplied to the ExecCommand method at call time, and may or may not // be used by the quorum function. If the in parameter is not needed // you should implement your quorum function with '_ *Command'. ExecCommandQF(in *Command, replies map[uint32]*emptypb.Empty) (*emptypb.Empty, bool) }
QuorumSpec is the interface of quorum functions for Client.