Documentation
¶
Index ¶
- Variables
- func RegisterHandelServer(srv *gorums.Server, impl Handel)
- type Configuration
- type Contribution
- func (*Contribution) Descriptor() ([]byte, []int)deprecated
- func (x *Contribution) GetHash() []byte
- func (x *Contribution) GetID() uint32
- func (x *Contribution) GetIndividual() *hotstuffpb.QuorumSignature
- func (x *Contribution) GetLevel() uint32
- func (x *Contribution) GetSignature() *hotstuffpb.QuorumSignature
- func (*Contribution) ProtoMessage()
- func (x *Contribution) ProtoReflect() protoreflect.Message
- func (x *Contribution) Reset()
- func (x *Contribution) String() string
- type Handel
- type Manager
- type Node
- type QuorumSpec
Constants ¶
This section is empty.
Variables ¶
var File_internal_proto_handelpb_handel_proto protoreflect.FileDescriptor
Functions ¶
func RegisterHandelServer ¶
Types ¶
type Configuration ¶
type Configuration struct { gorums.RawConfiguration // contains filtered or unexported fields }
A Configuration represents a static set of nodes on which quorum remote procedure calls may be invoked.
func ConfigurationFromRaw ¶
func ConfigurationFromRaw(rawCfg gorums.RawConfiguration, qspec QuorumSpec) *Configuration
ConfigurationFromRaw returns a new Configuration from the given raw configuration and QuorumSpec.
This function may for example be used to "clone" a configuration but install a different QuorumSpec:
cfg1, err := mgr.NewConfiguration(qspec1, opts...) cfg2 := ConfigurationFromRaw(cfg1.RawConfig, qspec2)
func (Configuration) And ¶
func (c Configuration) And(d *Configuration) gorums.NodeListOption
And returns a NodeListOption that can be used to create a new configuration combining c and d.
func (Configuration) Except ¶
func (c Configuration) Except(rm *Configuration) gorums.NodeListOption
Except returns a NodeListOption that can be used to create a new configuration from c without the nodes in rm.
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.
NOTE: mutating the returned slice is not supported.
type Contribution ¶
type Contribution struct { ID uint32 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` Level uint32 `protobuf:"varint,2,opt,name=Level,proto3" json:"Level,omitempty"` Signature *hotstuffpb.QuorumSignature `protobuf:"bytes,3,opt,name=Signature,proto3" json:"Signature,omitempty"` Individual *hotstuffpb.QuorumSignature `protobuf:"bytes,4,opt,name=Individual,proto3" json:"Individual,omitempty"` Hash []byte `protobuf:"bytes,5,opt,name=Hash,proto3" json:"Hash,omitempty"` // contains filtered or unexported fields }
func (*Contribution) Descriptor
deprecated
func (*Contribution) Descriptor() ([]byte, []int)
Deprecated: Use Contribution.ProtoReflect.Descriptor instead.
func (*Contribution) GetHash ¶
func (x *Contribution) GetHash() []byte
func (*Contribution) GetID ¶
func (x *Contribution) GetID() uint32
func (*Contribution) GetIndividual ¶
func (x *Contribution) GetIndividual() *hotstuffpb.QuorumSignature
func (*Contribution) GetLevel ¶
func (x *Contribution) GetLevel() uint32
func (*Contribution) GetSignature ¶
func (x *Contribution) GetSignature() *hotstuffpb.QuorumSignature
func (*Contribution) ProtoMessage ¶
func (*Contribution) ProtoMessage()
func (*Contribution) ProtoReflect ¶
func (x *Contribution) ProtoReflect() protoreflect.Message
func (*Contribution) Reset ¶
func (x *Contribution) Reset()
func (*Contribution) String ¶
func (x *Contribution) String() string
type Handel ¶
type Handel interface {
Contribute(ctx gorums.ServerCtx, request *Contribution)
}
Handel is the server-side API for the Handel Service
type Manager ¶
type Manager struct {
*gorums.RawManager
}
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(opts ...gorums.ConfigOption) (c *Configuration, err error)
NewConfiguration returns a configuration based on the provided list of nodes (required) and an optional quorum specification. The QuorumSpec is necessary for call types that must process replies. For configurations only used for unicast or multicast call types, a QuorumSpec is not needed. The QuorumSpec interface is also a ConfigOption. Nodes can be supplied using WithNodeMap or WithNodeList, or WithNodeIDs. A new configuration can also be created from an existing configuration, using the And, WithNewNodes, Except, and WithoutNodes methods.
type Node ¶
Node encapsulates the state of a node on which a remote procedure call can be performed.
func (*Node) Contribute ¶
func (n *Node) Contribute(ctx context.Context, in *Contribution, opts ...gorums.CallOption)
Contribute is a quorum call invoked on all nodes in configuration c, with the same argument in, and returns a combined result.
type QuorumSpec ¶
type QuorumSpec interface { gorums.ConfigOption }
QuorumSpec is the interface of quorum functions for Handel.