Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var File_metadata_metadata_proto protoreflect.FileDescriptor
Functions ¶
func RegisterMetadataTestServer ¶
func RegisterMetadataTestServer(srv *gorums.Server, impl MetadataTest)
Types ¶
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) 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.
type IPAddr ¶
type IPAddr struct { Addr string `protobuf:"bytes,1,opt,name=Addr,proto3" json:"Addr,omitempty"` // contains filtered or unexported fields }
func (*IPAddr) Descriptor
deprecated
func (*IPAddr) ProtoMessage ¶
func (*IPAddr) ProtoMessage()
func (*IPAddr) ProtoReflect ¶
func (x *IPAddr) ProtoReflect() protoreflect.Message
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(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 MetadataTest ¶
type MetadataTest interface { IDFromMD(context.Context, *emptypb.Empty, func(*NodeID, error)) WhatIP(context.Context, *emptypb.Empty, func(*IPAddr, error)) }
MetadataTest is the server-side API for the MetadataTest Service
type NodeID ¶
type NodeID struct { ID uint32 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` // contains filtered or unexported fields }
func (*NodeID) Descriptor
deprecated
func (*NodeID) ProtoMessage ¶
func (*NodeID) ProtoMessage()
func (*NodeID) ProtoReflect ¶
func (x *NodeID) ProtoReflect() protoreflect.Message
type QuorumSpec ¶
type QuorumSpec interface { gorums.ConfigOption }
QuorumSpec is the interface of quorum functions for MetadataTest.