cmd

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MAXRETRY = 5

MAXRETRY defines number of times to try upload data to storj before throwing error

Functions

func ConnectToStorj

func ConnectToStorj(fullFileName string, 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 GetFileAndObjectNames

func GetFileAndObjectNames(zenkoReader *ZenkoReader) ([]string, []*minio.Object)

GetFileAndObjectNames will return all file names and their corresponding Reader Object for upload

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, uploadPathName string, objectReader *minio.Object)

UploadData uploads the backup file to storj network.

Types

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 ConfigZenko

type ConfigZenko struct {
	EndPoint        string `json:"zenkoEndpoint"`
	AccessKeyID     string `json:"accessKeyID"`
	SecretAccessKey string `json:"secretAccessKey"`
}

ConfigZenko defines the variables and types.

func LoadZenkoProperty

func LoadZenkoProperty(fullFileName string) ConfigZenko

LoadZenkoProperty reads and parses the JSON file that contains a Zenko instance's property and returns all the properties as an object.

type ZenkoReader

type ZenkoReader struct {
	Client *minio.Client
}

ZenkoReader implements an io.Reader interface

func ConnectToZenko

func ConnectToZenko(configZenko ConfigZenko) *ZenkoReader

ConnectToZenko will connect to a Zenko instance, based on the read property from an external file. It returns a reference to an io.Reader with Zenko instance information

Jump to

Keyboard shortcuts

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