Documentation ¶
Index ¶
- type Client
- func (c *Client) Destroy()
- func (c *Client) SendAddReplica(host string, kgname fred.KeygroupName, node fred.Node, expiry int) error
- func (c *Client) SendAppend(host string, kgname fred.KeygroupName, id string, value string) error
- func (c *Client) SendCreateKeygroup(host string, kgname fred.KeygroupName, expiry int) error
- func (c *Client) SendDelete(host string, kgname fred.KeygroupName, id string) error
- func (c *Client) SendDeleteKeygroup(host string, kgname fred.KeygroupName) error
- func (c *Client) SendGetAllItems(host string, kgname fred.KeygroupName) ([]fred.Item, error)
- func (c *Client) SendGetItem(host string, kgname fred.KeygroupName, id string) (fred.Item, error)
- func (c *Client) SendRemoveReplica(host string, kgname fred.KeygroupName, node fred.Node) error
- func (c *Client) SendUpdate(host string, kgname fred.KeygroupName, id string, value string) error
- type Server
- func (s *Server) AddReplica(_ context.Context, request *peering.AddReplicaRequest) (*peering.Empty, error)
- func (s *Server) AppendItem(_ context.Context, request *peering.AppendItemRequest) (*peering.Empty, error)
- func (s *Server) Close() error
- func (s *Server) CreateKeygroup(_ context.Context, request *peering.CreateKeygroupRequest) (*peering.Empty, error)
- func (s *Server) DeleteItem(_ context.Context, request *peering.DeleteItemRequest) (*peering.Empty, error)
- func (s *Server) DeleteKeygroup(_ context.Context, request *peering.DeleteKeygroupRequest) (*peering.Empty, error)
- func (s *Server) GetAllItems(_ context.Context, request *peering.GetAllItemsRequest) (*peering.GetAllItemsResponse, error)
- func (s *Server) GetItem(_ context.Context, request *peering.GetItemRequest) (*peering.GetItemResponse, error)
- func (s *Server) PutItem(_ context.Context, request *peering.PutItemRequest) (*peering.Empty, error)
- func (s *Server) RemoveReplica(_ context.Context, request *peering.RemoveReplicaRequest) (*peering.Empty, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an peering client to communicate with peers.
func (*Client) Destroy ¶
func (c *Client) Destroy()
Destroy currently does nothing, but might delete open connections if they are implemented
func (*Client) SendAddReplica ¶
func (c *Client) SendAddReplica(host string, kgname fred.KeygroupName, node fred.Node, expiry int) error
SendAddReplica sends this command to the server at this address
func (*Client) SendAppend ¶
SendAppend sends this command to the server at this address
func (*Client) SendCreateKeygroup ¶
SendCreateKeygroup sends this command to the server at this address
func (*Client) SendDelete ¶
SendDelete sends this command to the server at this address
func (*Client) SendDeleteKeygroup ¶
func (c *Client) SendDeleteKeygroup(host string, kgname fred.KeygroupName) error
SendDeleteKeygroup sends this command to the server at this address
func (*Client) SendGetAllItems ¶
SendGetAllItems sends this command to the server at this address
func (*Client) SendGetItem ¶
SendGetItem sends this command to the server at this address
func (*Client) SendRemoveReplica ¶
SendRemoveReplica sends this command to the server at this address
func (*Client) SendUpdate ¶
SendUpdate sends this command to the server at this address
type Server ¶
Server is a grpc server that let's peers access the internal handler.
func NewServer ¶
func NewServer(host string, handler fred.IntHandler, certFile string, keyFile string, caFile string) *Server
NewServer creates a new Server for communication to the inthandler from other nodes
func (*Server) AddReplica ¶
func (s *Server) AddReplica(_ context.Context, request *peering.AddReplicaRequest) (*peering.Empty, error)
AddReplica calls this Method on the Inthandler
func (*Server) AppendItem ¶
func (s *Server) AppendItem(_ context.Context, request *peering.AppendItemRequest) (*peering.Empty, error)
AppendItem calls HandleAppend on the Inthandler
func (*Server) CreateKeygroup ¶
func (s *Server) CreateKeygroup(_ context.Context, request *peering.CreateKeygroupRequest) (*peering.Empty, error)
CreateKeygroup calls this Method on the Inthandler
func (*Server) DeleteItem ¶
func (s *Server) DeleteItem(_ context.Context, request *peering.DeleteItemRequest) (*peering.Empty, error)
DeleteItem calls this Method on the Inthandler
func (*Server) DeleteKeygroup ¶
func (s *Server) DeleteKeygroup(_ context.Context, request *peering.DeleteKeygroupRequest) (*peering.Empty, error)
DeleteKeygroup calls this Method on the Inthandler
func (*Server) GetAllItems ¶
func (s *Server) GetAllItems(_ context.Context, request *peering.GetAllItemsRequest) (*peering.GetAllItemsResponse, error)
GetAllItems has no implementation
func (*Server) GetItem ¶
func (s *Server) GetItem(_ context.Context, request *peering.GetItemRequest) (*peering.GetItemResponse, error)
GetItem has no implementation
func (*Server) PutItem ¶
func (s *Server) PutItem(_ context.Context, request *peering.PutItemRequest) (*peering.Empty, error)
PutItem calls HandleUpdate on the Inthandler
func (*Server) RemoveReplica ¶
func (s *Server) RemoveReplica(_ context.Context, request *peering.RemoveReplicaRequest) (*peering.Empty, error)
RemoveReplica calls this Method on the Inthandler