Documentation ¶
Index ¶
- Variables
- func ConnectToPydio(configPydioRest ConfigPydioRest) ([]string, string)
- func ConnectToStorj(fullFileName string, configStorj ConfigStorj, accesskey bool) (*uplink.Access, *uplink.Project)
- func Execute()
- func GetApiClient(sdkConfig *cells_sdk.SdkConfig, anonymous ...bool) (context.Context, *client.PydioCellsRest, error)
- func GetFile(pathToFile string) (io.Reader, int, error)
- func GetFileNames(configPydioRest ConfigPydioRest, workspaces []string) []string
- func GetS3Client() (*s3.S3, string, error)
- func ShareAccess(access *uplink.Access, configStorj ConfigStorj)
- func UploadData(project *uplink.Project, configStorj ConfigStorj, uploadPathName string, ...)
- type ConfigPydioRest
- type ConfigPydioS3
- type ConfigStorj
- type Stack
Constants ¶
This section is empty.
Variables ¶
var MAXRETRY = 5
MAXRETRY defines number of times to try upload data to storj before throwing error
Functions ¶
func ConnectToPydio ¶
func ConnectToPydio(configPydioRest ConfigPydioRest) ([]string, string)
ConnectToPydio will connect to a Pydio Cells instance, based on the read property from an external file. It returns list of workspaces in the Pydio Cells instance and the backup prefix path name
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 GetApiClient ¶
func GetApiClient(sdkConfig *cells_sdk.SdkConfig, anonymous ...bool) (context.Context, *client.PydioCellsRest, error)
GetApiClient connects to the Pydio Cells server defined by this config, by sending an authentication request to the OIDC service to get a valid JWT (or taking the JWT from cache). Also returns a context to be used in subsequent requests.
func GetFileNames ¶
func GetFileNames(configPydioRest ConfigPydioRest, workspaces []string) []string
GetFileNames will return all the file names in the Pydio Cells instance
func GetS3Client ¶
GetS3Client returns the Pydio Cells S3 Client which is required for getting io.Reader implementor from GetFile function
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 io.Reader)
UploadData uploads the backup file to storj network.
Types ¶
type ConfigPydioRest ¶
ConfigPydioRest type alias for cells_sdk
func LoadPydioProperty ¶
func LoadPydioProperty(fullFileName string) ConfigPydioRest
LoadPydioProperty reads and parses the JSON file that contains a Pydio Cells instance's property and returns all the properties as REST object
type ConfigPydioS3 ¶
ConfigPydioS3 type alias for cells_sdk
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.