api

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backup added in v0.3.0

type Backup struct {
	ID              core.InstanceID `json:"_id"` // DeviceID
	LatestBackupCid string
	UpdatedAt       time.Time
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides the client api.

func NewClient

func NewClient(target string, opts ...grpc.DialOption) (*Client, error)

NewClient starts the client.

func (*Client) AddBackup

func (c *Client) AddBackup(ctx context.Context, backupDir string) (*pb.AddBackupReply, error)

AddBackup adds a new backup to IPFS

func (*Client) Close

func (c *Client) Close() error

Close closes the client's grpc connection and cancels any active requests.

func (*Client) Export added in v0.3.0

func (c *Client) Export(ctx context.Context) (*pb.ExportReply, error)

Export returns the information needed to share backups with another device

func (*Client) ListBackups

func (c *Client) ListBackups(ctx context.Context) (*pb.ListBackupsReply, error)

ListBackups lists all known backups

func (*Client) UpdateLatestBackup

func (c *Client) UpdateLatestBackup(ctx context.Context, deviceID string, backupCid string) (*pb.UpdateLatestBackupReply, error)

UpdateLatestBackup saves a reference to the latest backup

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is a gRPC service

func NewService

func NewService(ipfs icore.CoreAPI, d *db.DB) (*Service, error)

func (*Service) AddBackup

func (s *Service) AddBackup(ctx context.Context, req *pb.AddBackupRequest) (*pb.AddBackupReply, error)

AddBackup adds a new backup to IPFS

func (*Service) Export added in v0.3.0

func (s *Service) Export(ctx context.Context, req *pb.ExportRequest) (*pb.ExportReply, error)

Export returns the information needed to share backups with another device

func (*Service) ListBackups

func (s *Service) ListBackups(ctx context.Context, req *pb.ListBackupsRequest) (*pb.ListBackupsReply, error)

ListBackups lists all known backups

func (*Service) UpdateLatestBackup

func (s *Service) UpdateLatestBackup(ctx context.Context, req *pb.UpdateLatestBackupRequest) (*pb.UpdateLatestBackupReply, error)

UpdateLatestBackup saves a reference to the latest backup

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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