Documentation ¶
Overview ¶
Package go_sheep is a generated protocol buffer package.
It is generated from these files:
state.proto
It has these top-level messages:
DelegateCheckRequest States Target Node State
Index ¶
- func LaunchStateHandler(n *Node, failureDetector SWIM, logger zap.Logger) (chan<- Request, chan<- struct{})
- func NewCheckError(s, t *Node, err error) error
- func RegisterSWIMServer(s *grpc.Server, srv SWIMServer)
- type CheckError
- type DelegateCheckRequest
- type Errors
- type NetworkError
- type Node
- type Request
- type Response
- type SWIM
- type SWIMClient
- type SWIMServer
- type SafeState
- type State
- type StateAction
- type States
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LaunchStateHandler ¶
func NewCheckError ¶
func RegisterSWIMServer ¶
func RegisterSWIMServer(s *grpc.Server, srv SWIMServer)
Types ¶
type CheckError ¶
func (*CheckError) Error ¶
func (c *CheckError) Error() string
type DelegateCheckRequest ¶
type DelegateCheckRequest struct { State *State `protobuf:"bytes,1,opt,name=state" json:"state,omitempty"` Target *Node `protobuf:"bytes,2,opt,name=target" json:"target,omitempty"` }
func (*DelegateCheckRequest) Descriptor ¶
func (*DelegateCheckRequest) Descriptor() ([]byte, []int)
func (*DelegateCheckRequest) GetState ¶
func (m *DelegateCheckRequest) GetState() *State
func (*DelegateCheckRequest) GetTarget ¶
func (m *DelegateCheckRequest) GetTarget() *Node
func (*DelegateCheckRequest) ProtoMessage ¶
func (*DelegateCheckRequest) ProtoMessage()
func (*DelegateCheckRequest) Reset ¶
func (m *DelegateCheckRequest) Reset()
func (*DelegateCheckRequest) String ¶
func (m *DelegateCheckRequest) String() string
type NetworkError ¶
type NetworkError struct {
// contains filtered or unexported fields
}
type Node ¶
type Node struct { Uuid string `protobuf:"bytes,1,opt,name=uuid" json:"uuid,omitempty"` Address string `protobuf:"bytes,2,opt,name=address" json:"address,omitempty"` LastSeen *google_protobuf.Timestamp `protobuf:"bytes,3,opt,name=lastSeen" json:"lastSeen,omitempty"` }
Node contains membership information of a particular host
func (*Node) Descriptor ¶
func (*Node) GetAddress ¶
func (*Node) GetLastSeen ¶
func (m *Node) GetLastSeen() *google_protobuf.Timestamp
func (*Node) ProtoMessage ¶
func (*Node) ProtoMessage()
type Request ¶
type Request struct { Action StateAction ResponseCh chan *Response Payload interface{} }
type SWIM ¶
type SWIM interface { // RandomizedTarget returns a Node to ping that is not equal to 'currentNodeInfo' // or error if no valid address is found. GetRandomizedTarget(s *State, currentNodeInfo *Node) (*Node, error) // Checkers returns 'n' addresses:ports to check the existence of 't', which is also an address:port. GetCheckers(s *State, t, cur *Node, n int) ([]*Node, error) // Merge state takes a state A and merges it with a state B returning the merged result MergeState(a, b *State) (*State, error) }
type SWIMClient ¶
type SWIMClient interface { // Ping sends State to a previously randomized address to retrieve its state already merge with ours. Ping(ctx context.Context, in *State, opts ...grpc.CallOption) (*State, error) // DelegateCheck sends State to a delegated node so it can check agains Target node. Returns: // - The state of the target AND the delegated node (the node we are connecting to) // - The state of the delegated node and an error if it couldn't get state from Target // - An error only if something happened DelegateCheck(ctx context.Context, in *DelegateCheckRequest, opts ...grpc.CallOption) (*State, error) Join(ctx context.Context, in *Node, opts ...grpc.CallOption) (*State, error) }
func NewSWIMClient ¶
func NewSWIMClient(cc *grpc.ClientConn) SWIMClient
type SWIMServer ¶
type SWIMServer interface { // Ping sends State to a previously randomized address to retrieve its state already merge with ours. Ping(context.Context, *State) (*State, error) // DelegateCheck sends State to a delegated node so it can check agains Target node. Returns: // - The state of the target AND the delegated node (the node we are connecting to) // - The state of the delegated node and an error if it couldn't get state from Target // - An error only if something happened DelegateCheck(context.Context, *DelegateCheckRequest) (*State, error) Join(context.Context, *Node) (*State, error) }
type State ¶
type State struct {
Nodes []*Node `protobuf:"bytes,4,rep,name=Nodes,json=nodes" json:"Nodes,omitempty"`
}
State represents an array of Node with their current membership info. Each host must have an stored state.
func (*State) Descriptor ¶
func (*State) ProtoMessage ¶
func (*State) ProtoMessage()
type States ¶
type States struct {
States []*State `protobuf:"bytes,1,rep,name=States,json=states" json:"States,omitempty"`
}
States is an array of State objects
func (*States) Descriptor ¶
func (*States) ProtoMessage ¶
func (*States) ProtoMessage()
type Target ¶
type Target struct {
Address string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"`
}
Target is a Node that will be pinged by delegated Nodes
func (*Target) Descriptor ¶
func (*Target) GetAddress ¶
func (*Target) ProtoMessage ¶
func (*Target) ProtoMessage()
Click to show internal directories.
Click to hide internal directories.