Documentation
¶
Index ¶
- type Server
- func (s *Server) AddFiles(req *zync.RegexRequest, afs zync.Zync_AddFilesServer) error
- func (s *Server) Backup(ctx context.Context, req *zync.BackupRequest) (*zync.BackupStatus, error)
- func (s *Server) DeleteFiles(req *zync.RegexRequest, dfs zync.Zync_DeleteFilesServer) error
- func (s *Server) HandleTerminate(sig os.Signal) error
- func (s *Server) ListFiles(req *zync.RegexRequest, lfs zync.Zync_ListFilesServer) error
- func (s *Server) Restore(req *zync.RestoreRequest, rs zync.Zync_RestoreServer) error
- func (s *Server) Start() error
- func (s *Server) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
zync.UnimplementedZyncServer
// contains filtered or unexported fields
}
Server provides a gRPC interface for interacting with watched files stored in IPFS
func NewServer ¶
func NewServer(port int, sh *shell.Shell, backupLoc string, refreshInterval time.Duration) (*Server, error)
NewServer constructs a new gPRC server for the daemon
func (*Server) AddFiles ¶
func (s *Server) AddFiles(req *zync.RegexRequest, afs zync.Zync_AddFilesServer) error
AddFiles adds a single file to IPFS if the provided path is to an individual file, or it will recursively add all files within a directory if the provided path is a directory
func (*Server) Backup ¶
func (s *Server) Backup(ctx context.Context, req *zync.BackupRequest) (*zync.BackupStatus, error)
Backup communicates to the server that any cached data should be backed up to IPFS, returning the resulting CID
func (*Server) DeleteFiles ¶
func (s *Server) DeleteFiles(req *zync.RegexRequest, dfs zync.Zync_DeleteFilesServer) error
DeleteFiles removes all files matching the pattern from zync
func (*Server) HandleTerminate ¶
HandleTerminate stops the server if terminate signal is received
func (*Server) ListFiles ¶
func (s *Server) ListFiles(req *zync.RegexRequest, lfs zync.Zync_ListFilesServer) error
ListFiles lists all files matching the pattern from zync
func (*Server) Restore ¶
func (s *Server) Restore(req *zync.RestoreRequest, rs zync.Zync_RestoreServer) error
Restore initiates the process of restoring files from IPFS to the host machine