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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 CreateBackup

func CreateBackup(configMariaDB ConfigMariaDB) *bytes.Reader

CreateBackup creates back-up and returns the corresponding reader object to upload back-up to storj.

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 io.Reader)

UploadData uploads the backup file to storj network.

Types

type ConfigMariaDB

type ConfigMariaDB struct {
	HostName   string `json:"hostname"`
	PortNumber string `json:"port"`
	UserName   string `json:"username"`
	Password   string `json:"password"`
	Database   string `json:"database"`
}

ConfigMariaDB stores the MariaDB configuration parameters.

func LoadMariaProperty

func LoadMariaProperty(fullFileName string) ConfigMariaDB

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

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.

Jump to

Keyboard shortcuts

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