app

package
v0.0.0-...-3c3b1c7 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: AGPL-3.0-or-later Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DEBUG = false

Toogle for switching to debug mode & verbose logs

View Source
const FilesetNamePrefix string = "fs-"

Prefix for the filesets name - default

View Source
const TenantIDMock string = "tmock"

Mock for the default Tenant ID

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientContext

type ClientContext struct {
	// VRFS service
	Vrfs rservice.VrfsService

	// File Transfer service
	Nfs rservice.FTService
}

Client application context grouping the accesses to remote services

func NewClientContext

func NewClientContext(vrfsEndpoint string, nfsEndpoint string, chunkSize int) (*ClientContext, error)

Init the application context

func (*ClientContext) DownloadFile

func (ctx *ClientContext) DownloadFile(fileSetID string, fileIndex int, downDirPath string) error

DownloadFile is the method for downloading a file, from its index as part of a known fileset, to the specified local directory from the Remote FS store and Verify its consistency, i.e. the hash of the downloaded file and the merkle proofs downloaded from VRFS are verified against the expected fileset's merkle tree root.

The specified fileset ID is the one provided by the VRFS service when the fileset was initially uploaded. The local directory FS path for the file to be downloaded must also to specified, e.g. './localdowndir/'.

An error is returned in case an issue is met.

func (*ClientContext) UploadFileset

func (ctx *ClientContext) UploadFileset(localDirPath string, concurrencyMax int) error

UploadFileset is the method for initiating the verified upload protocol of all files found under the specified local directory path The maximum batch size of files to be concurrently uploaded is specified, it must be greater than 0

Jump to

Keyboard shortcuts

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