Documentation
¶
Index ¶
- type Comms
- func (rc *Comms) GetLastModified(ctx context.Context, message *pb.RsReadRequest) (*pb.RsTimestampResponse, error)
- func (rc *Comms) GetLastWrite(ctx context.Context, message *pb.RsLastWriteRequest) (*pb.RsTimestampResponse, error)
- func (rc *Comms) Login(ctx context.Context, message *pb.RsAuthenticationRequest) (*pb.RsAuthenticationResponse, error)
- func (rc *Comms) Read(ctx context.Context, message *pb.RsReadRequest) (*pb.RsReadResponse, error)
- func (rc *Comms) ReadDir(ctx context.Context, message *pb.RsReadRequest) (*pb.RsReadDirResponse, error)
- func (rc *Comms) Write(ctx context.Context, message *pb.RsWriteRequest) (*messages.Ack, error)
- type Handler
- type Implementation
- func (s *Implementation) GetLastModified(message *pb.RsReadRequest) (*pb.RsTimestampResponse, error)
- func (s *Implementation) GetLastWrite(message *messages.Ack) (*pb.RsTimestampResponse, error)
- func (s *Implementation) Login(message *pb.RsAuthenticationRequest) (*pb.RsAuthenticationResponse, error)
- func (s *Implementation) Read(message *pb.RsReadRequest) (*pb.RsReadResponse, error)
- func (s *Implementation) ReadDir(message *pb.RsReadRequest) (*pb.RsReadDirResponse, error)
- func (s *Implementation) Write(message *pb.RsWriteRequest) (*messages.Ack, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comms ¶
type Comms struct { *connect.ProtoComms *pb.UnimplementedRemoteSyncServer *messages.UnimplementedGenericServer // contains filtered or unexported fields }
Comms object bundles low-level connect.ProtoComms, and the endpoint Handler interface.
func StartRemoteSync ¶
StartRemoteSync starts a new RemoteSync server on the address:port specified by localServer and a callback interface for remote sync operations with given path to public and private key for TLS connection.
func (*Comms) GetLastModified ¶
func (rc *Comms) GetLastModified(ctx context.Context, message *pb.RsReadRequest) (*pb.RsTimestampResponse, error)
GetLastModified returns the last time a resource was modified
func (*Comms) GetLastWrite ¶
func (rc *Comms) GetLastWrite(ctx context.Context, message *pb.RsLastWriteRequest) (*pb.RsTimestampResponse, error)
GetLastWrite returns the last time this remote sync server was modified
func (*Comms) Login ¶
func (rc *Comms) Login(ctx context.Context, message *pb.RsAuthenticationRequest) (*pb.RsAuthenticationResponse, error)
Login to the server, receiving a token
func (*Comms) Read ¶
func (rc *Comms) Read(ctx context.Context, message *pb.RsReadRequest) (*pb.RsReadResponse, error)
Read data from the server
func (*Comms) ReadDir ¶
func (rc *Comms) ReadDir(ctx context.Context, message *pb.RsReadRequest) (*pb.RsReadDirResponse, error)
ReadDir reads a directory from the server
type Handler ¶
type Handler interface { Login(*pb.RsAuthenticationRequest) (*pb.RsAuthenticationResponse, error) Read(*pb.RsReadRequest) (*pb.RsReadResponse, error) Write(*pb.RsWriteRequest) (*messages.Ack, error) GetLastModified(*pb.RsReadRequest) (*pb.RsTimestampResponse, error) GetLastWrite(*pb.RsLastWriteRequest) (*pb.RsTimestampResponse, error) ReadDir(*pb.RsReadRequest) (*pb.RsReadDirResponse, error) }
Handler describes the endpoint callbacks for remote sync.
type Implementation ¶
type Implementation struct {
Functions implementationFunctions
}
Implementation allows users of the client library to set the functions that implement the node functions.
func NewImplementation ¶
func NewImplementation() *Implementation
NewImplementation creates and returns a new Handler interface for implementing endpoint callbacks.
func (*Implementation) GetLastModified ¶
func (s *Implementation) GetLastModified(message *pb.RsReadRequest) (*pb.RsTimestampResponse, error)
func (*Implementation) GetLastWrite ¶
func (s *Implementation) GetLastWrite(message *messages.Ack) (*pb.RsTimestampResponse, error)
func (*Implementation) Login ¶
func (s *Implementation) Login(message *pb.RsAuthenticationRequest) (*pb.RsAuthenticationResponse, error)
func (*Implementation) Read ¶
func (s *Implementation) Read(message *pb.RsReadRequest) (*pb.RsReadResponse, error)
func (*Implementation) ReadDir ¶
func (s *Implementation) ReadDir(message *pb.RsReadRequest) (*pb.RsReadDirResponse, error)
func (*Implementation) Write ¶
func (s *Implementation) Write(message *pb.RsWriteRequest) (*messages.Ack, error)