cmd

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToLocalDisk

func ConnectToLocalDisk(configLocalFile ConfigLocalFile) *os.File

ConnectToLocalDisk takes the configuration object as argument and returns the reader of the source file to be uploaded. ****Modify the Function to connect to the required source instance

and return the file(s) or reader of the file****

func ConnectToStorj

func ConnectToStorj(configStorj ConfigStorj, accesskey bool) (*uplink.Access, *uplink.Project)

ConnectToStorj reads Storj configuration from given file and connects to the desired Storj network. It then reads data property from an external file.

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func ShareAccess

func ShareAccess(access *uplink.Access, configStorj ConfigStorj)

ShareAccess generates and prints the shareable serialized access as per the restrictions provided by the user.

func UploadData

func UploadData(project *uplink.Project, configStorj ConfigStorj, uploadFileName string, fileReader *os.File)

UploadData uploads the backup file to storj network.

Types

type ConfigLocalFile

type ConfigLocalFile struct {
	Path string `json:"path"`
}

ConfigLocalFile stores the local file path. ****Change this strcuture to store the configurations and credentials

of whatever the source being used****

func LoadLocalProperty

func LoadLocalProperty(fullFileName string) ConfigLocalFile

LoadLocalProperty reads and parses the configuration JSON file that contains a local file path and returns it embedded in a configuration object. ****Change the Function name and add print statements as per the required configurations****

type ConfigStorj

type ConfigStorj struct {
	APIKey               string `json:"apikey"`
	Satellite            string `json:"satellite"`
	Bucket               string `json:"bucket"`
	UploadPath           string `json:"uploadPath"`
	EncryptionPassphrase string `json:"encryptionpassphrase"`
	SerializedAccess     string `json:"serializedAccess"`
	AllowDownload        string `json:"allowDownload"`
	AllowUpload          string `json:"allowUpload"`
	AllowList            string `json:"allowList"`
	AllowDelete          string `json:"allowDelete"`
	NotBefore            string `json:"notBefore"`
	NotAfter             string `json:"notAfter"`
}

ConfigStorj depicts keys to search for within the stroj_config.json file.

func LoadStorjConfiguration

func LoadStorjConfiguration(fullFileName string) ConfigStorj

LoadStorjConfiguration reads and parses the JSON file that contain Storj configuration information.

type Metric added in v1.4.5

type Metric struct {
	Function   string `json:"Function"`
	StartHeap  uint64 `json:"StartHeap"`
	StartStack uint64 `json:"StartStack"`
	EndHeap    uint64 `json:"EndHeap"`
	EndStack   uint64 `json:"EndStack"`
	StartTime  int64  `json:"StartTime"`
	EndTime    int64  `json:"EndTime"`
}

Metric represents basic execution metric

Jump to

Keyboard shortcuts

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