Documentation ¶
Index ¶
- Variables
- func ConnectToIPFSForDownload(hash string, hostName string, port string) *bytes.Reader
- func ConnectToIpfs(configIpfs ConfigIpfs) *shell.Shell
- func ConnectToStorj(fullFileName string, configStorj ConfigStorj, accesskey bool) (*uplink.Access, *uplink.Project)
- func CreateCID(sh *shell.Shell, data []byte) string
- func DownloadData(project *uplink.Project, downloadConfigStorj DownloadConfigStorj, ...)
- func Execute()
- func GetReader(sh *shell.Shell, configIpfs ConfigIpfs) io.ReadCloser
- func GetReaderDownload(sh *shell.Shell, hash string) *bytes.Reader
- func ShareAccess(access *uplink.Access, configStorj ConfigStorj)
- func UploadData(project *uplink.Project, configStorj ConfigStorj, uploadFileName string, ...)
- type ConfigIpfs
- type ConfigStorj
- type DownloadConfigStorj
Constants ¶
This section is empty.
Variables ¶
var DownCmd = &cobra.Command{
Use: "download",
Short: "Command to download data from storj V3 network.",
Long: `Command to download data from the Storj Bucket using the Hash.`,
Run: storjDownload,
}
DownCmd represents the download command.
Functions ¶
func ConnectToIPFSForDownload ¶
ConnectToIPFSForDownload will connect to a IPFS instance, based on the hash name of file on IPFS. It returns a reference to an io.Reader with IPFS instance information
func ConnectToIpfs ¶
func ConnectToIpfs(configIpfs ConfigIpfs) *shell.Shell
ConnectToIpfs will connect to a IPFS instance, based on the read property from an external file. It returns a reference to an io.Reader with IPFS instance information.
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 CreateCID ¶
CreateCID will connect to a IPFS instance based on the read property from an external file. It returns Created CID.
func DownloadData ¶
func DownloadData(project *uplink.Project, downloadConfigStorj DownloadConfigStorj, readFile *bytes.Reader)
DownloadData function downloads the data from storj bucket after upload to verify data is uploaded successfully.
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, configIpfs ConfigIpfs) 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 GetReaderDownload ¶
GetReaderDownload 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"` Path string `json:"path"` ChunkSize string `json:"chunkSize"` }
ConfigIpfs defines the variables and types.
func LoadIpfsProperty ¶
func LoadIpfsProperty(fullFileName string) ConfigIpfs
LoadIpfsProperty reads and parses the JSON file that contain a IPFS instance's property. and returns all the properties as an object.
type ConfigStorj ¶
type ConfigStorj struct { Key string `json:"key"` 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 DownloadConfigStorj ¶
type DownloadConfigStorj struct { Hash string `json:"hash"` DownloadPath string `json:"downloadPath"` Key string `json:"key"` }
DownloadConfigStorj structure to store data from json file
func LoadStorjDownloadConfiguration ¶
func LoadStorjDownloadConfiguration(fullFileName string) DownloadConfigStorj
LoadStorjDownloadConfiguration reads and parses the JSON file that contain Storj configuration information.