Documentation ¶
Index ¶
- type EndPoint
- func (m *EndPoint) BatchIndex(stream pb.DStash_BatchIndexServer) error
- func (m *EndPoint) BatchLookup(stream pb.DStash_BatchLookupServer) error
- func (m *EndPoint) BatchPut(stream pb.DStash_BatchPutServer) error
- func (m *EndPoint) Items(e *empty.Empty, stream pb.DStash_ItemsServer) error
- func (m *EndPoint) Lookup(ctx context.Context, kv *pb.KVPair) (*pb.KVPair, error)
- func (m *EndPoint) Put(ctx context.Context, kv *pb.KVPair) (*empty.Empty, error)
- func (m *EndPoint) Search(searchStr *wrappers.StringValue, stream pb.DStash_SearchServer) error
- func (m *EndPoint) Start() error
- func (m *EndPoint) Status(ctx context.Context, e *empty.Empty) (*pb.StatusMessage, error)
- type HealthImpl
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EndPoint ¶
func NewEndPoint ¶
func (*EndPoint) BatchIndex ¶
func (m *EndPoint) BatchIndex(stream pb.DStash_BatchIndexServer) error
func (*EndPoint) BatchLookup ¶
func (m *EndPoint) BatchLookup(stream pb.DStash_BatchLookupServer) error
func (*EndPoint) Search ¶
func (m *EndPoint) Search(searchStr *wrappers.StringValue, stream pb.DStash_SearchServer) error
type HealthImpl ¶
type HealthImpl struct{}
func (*HealthImpl) Check ¶
func (h *HealthImpl) Check(ctx context.Context, req *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
Check implements the health check interface, which directly returns to health status. There are also more complex health check strategies, such as returning based on server load.
func (*HealthImpl) Watch ¶
func (h *HealthImpl) Watch(req *grpc_health_v1.HealthCheckRequest, w grpc_health_v1.Health_WatchServer) error
type Node ¶
type Node struct { Service *EndPoint // Shutdown channels Stop chan bool Err chan error // contains filtered or unexported fields }
Node is a single node in a distributed hash table, coordinated using services registered in Consul. Key membership is determined using rendezvous hashing to ensure even distribution of keys and minimal key membership changes when a Node fails or otherwise leaves the hash table.
Errors encountered when making blocking GET requests to the Consul agent API are logged using the log package.
func Join ¶
Join creates a new Node and adds it to the distributed hash table specified by the given name. The given id should be unique among all Nodes in the hash table.
func (*Node) Leave ¶
Leave removes the Node from the distributed hash table by de-registering it from Consul. Once Leave is called, the Node should be discarded. An error is returned if the Node is unable to successfully deregister itself from Consul. In that case, Consul's health check for the Node will fail and require manual cleanup.