daemon

package
v0.0.0-...-044d65f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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

func (s *Server) HandleTerminate(sig os.Signal) error

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

func (*Server) Start

func (s *Server) Start() error

Start launches the gRPC server

func (*Server) Stop

func (s *Server) Stop() error

Stop gracefully stops the gRPC server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL