Documentation ¶
Index ¶
- type Config
- type Server
- func (s *Server) Erase(ctx context.Context, req *internal.EraseRequest) (*internal.EraseResponse, error)
- func (s *Server) Join(ctx context.Context, req *internal.JoinRequest) (*internal.JoinResponse, error)
- func (s *Server) Ping(ctx context.Context, req *internal.PingRequest) (*internal.PingResponse, error)
- func (s *Server) Receive(ctx context.Context, req *api.ReceiveRequest) (*api.ReceiveResponse, error)
- func (s *Server) Send(ctx context.Context, req *api.SendRequest) (*api.SendResponse, error)
- func (s *Server) Start() <-chan error
- func (s *Server) Stop()
- func (s *Server) Unjoin(ctx context.Context, req *internal.UnjoinRequest) (*internal.UnjoinResponse, error)
- func (s *Server) Write(ctx context.Context, req *internal.WriteRequest) (*internal.WriteResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server structure represents QRPC node.
func (*Server) Erase ¶
func (s *Server) Erase(ctx context.Context, req *internal.EraseRequest) (*internal.EraseResponse, error)
Erase implements 'internal erase request endpoint'. The endpoint is used to delete the key from the server (becuase data were read from other peer).
func (*Server) Join ¶
func (s *Server) Join(ctx context.Context, req *internal.JoinRequest) (*internal.JoinResponse, error)
Join implements 'internal join request endpoint'. Updates address for requesting peer. Returns list of already known peers.
func (*Server) Ping ¶
func (s *Server) Ping(ctx context.Context, req *internal.PingRequest) (*internal.PingResponse, error)
Ping implements 'internal ping request endpoint'. The endpoint is mostly used by cluster's watcher for service discovery.
func (*Server) Receive ¶
func (s *Server) Receive(ctx context.Context, req *api.ReceiveRequest) (*api.ReceiveResponse, error)
Receive implements 'receive request endpoint'. Data will be read and erased from diskv. The server will also try to erase the read key from cluster's peers.
func (*Server) Send ¶
func (s *Server) Send(ctx context.Context, req *api.SendRequest) (*api.SendResponse, error)
Send implements 'send request endpoint'. Data will be stored in diskv and replicated across cluster's peers.
func (*Server) Start ¶
Start starts a qrpc server on specified port and tries to connect to existing cluster (if peers were specified). Returns an error channel which will be populated when server fail.
func (*Server) Unjoin ¶
func (s *Server) Unjoin(ctx context.Context, req *internal.UnjoinRequest) (*internal.UnjoinResponse, error)
Unjoin implements 'internal unjoin request endpoint'. Deletes requesting peer from lookup table.
func (*Server) Write ¶
func (s *Server) Write(ctx context.Context, req *internal.WriteRequest) (*internal.WriteResponse, error)
Write implements 'internal write request endpoint'. The endpoint is mostly used to replicate data across cluster's peers. If requesting req.Key already exists then data will be overwritten.