Documentation ¶
Index ¶
- Variables
- func ConnectToIpfs(configIpfs ConfigIpfs) *shell.Shell
- func ConnectToStorj(configStorj ConfigStorj, accesskey bool) (*uplink.Access, *uplink.Project)
- func Execute()
- func GetHash(sh *shell.Shell, hash string, path string)
- func GetReader(sh *shell.Shell, path string) io.ReadCloser
- func ShareAccess(access *uplink.Access, configStorj ConfigStorj)
- func UploadData(project *uplink.Project, configStorj ConfigStorj, uploadFileName string, ...)
- type ConfigIpfs
- type ConfigStorj
Constants ¶
This section is empty.
Variables ¶
var AllFilesWithPaths []string
AllFilesWithPaths is a list to store complete path of all the hash in the IPFS. It will be used for direct transfer of files from IPFS to Storj.
var AllHash []string
AllHash is a list to store hashes of all files to store from IPFS.
Functions ¶
func ConnectToIpfs ¶
func ConnectToIpfs(configIpfs ConfigIpfs) *shell.Shell
ConnectToIpfs will connect to an IPFS instance based on the read property from an external file. It returns a reference to shell with IPFS instance's information.
func ConnectToStorj ¶
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 GetReader ¶
func GetReader(sh *shell.Shell, path string) io.ReadCloser
GetReader returns a Reader of corresponding file whose path is specified. io.ReadCloser type of object returned is used to perform transfer of file to Storj.
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, reader io.Reader)
UploadData uploads the backup file to storj network.
Types ¶
type ConfigIpfs ¶
type ConfigIpfs struct { HostName string `json:"hostName"` Port string `json:"port"` Hash string `json:"hash"` }
ConfigIpfs defines the variables and types for login.
func LoadIpfsProperty ¶
func LoadIpfsProperty(fullFileName string) ConfigIpfs
LoadIpfsProperty reads and parses the JSON file that contains a IPFS instance's properties 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.