Documentation ¶
Index ¶
- Variables
- func ConnectToNextcloud(configNextcloud ConfigNextcloud) *gonextcloud.Client
- func ConnectToStorj(fullFileName string, configStorj ConfigStorj, accesskey bool) (*uplink.Access, *uplink.Project)
- func Execute()
- func GetFilesWithPaths(nextcloudClient *gonextcloud.Client, path string)
- func GetReader(nextcloudClient *gonextcloud.Client, path string) io.ReadCloser
- func ShareAccess(access *uplink.Access, configStorj ConfigStorj)
- func UploadData(project *uplink.Project, configStorj ConfigStorj, uploadFileName string, ...)
- type ConfigNextcloud
- type ConfigStorj
Constants ¶
This section is empty.
Variables ¶
var AllFilesWithPaths []string
AllFilesWithPaths is a list to store complete path of all the files in the Nextcloud. It will be used for direct transfer of files from Nextcloud to Storj.
Functions ¶
func ConnectToNextcloud ¶
func ConnectToNextcloud(configNextcloud ConfigNextcloud) *gonextcloud.Client
ConnectToNextcloud connects to Nextcloud by creating a new authenticated Nextcloud client. It returns a Nextcloud client instance to perform file transfer(back-up).
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 GetFilesWithPaths ¶
func GetFilesWithPaths(nextcloudClient *gonextcloud.Client, path string)
GetFilesWithPaths retrieve the files' names with the exact file structure from Nextcloud Server to the System
func GetReader ¶
func GetReader(nextcloudClient *gonextcloud.Client, 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, filePath string)
UploadData uploads the backup file to storj network.
Types ¶
type ConfigNextcloud ¶
type ConfigNextcloud struct { URL string `json:"url"` Username string `json:"username"` Password string `json:"password"` }
ConfigNextcloud defines the variables and types for login.
func LoadNextcloudProperty ¶
func LoadNextcloudProperty(fullFileName string) ConfigNextcloud
LoadNextcloudProperty reads and parses the JSON file that contains a Nextcloud instance's properties. It 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.