Documentation ¶
Index ¶
- func ConnectToStorj(configStorj ConfigStorj, accesskey bool) (*uplink.Access, *uplink.Project)
- func Execute()
- func MatchAndRestore(project *uplink.Project, matchPattern string, backupPath string, latest bool, ...)
- func RestoreData(project *uplink.Project, backupPath string, latest bool, showProgress bool)
- func ShareAccess(access *uplink.Access, configStorj ConfigStorj)
- func UploadData(project *uplink.Project, configStorj ConfigStorj, uploadFileName string, ...)
- type ConfigMongoDB
- type ConfigStorj
- type MongoReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 MatchAndRestore ¶
func MatchAndRestore(project *uplink.Project, matchPattern string, backupPath string, latest bool, showProgress bool)
MatchAndRestore finds the databases corresponding the pattern entered by the user and restores the latest backup of each matching database.
func RestoreData ¶
RestoreData restores the latest backup correspoinding to the path provided
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, dbReader io.Reader, firstCollection string)
UploadData uploads the backup file to storj network.
Types ¶
type ConfigMongoDB ¶
type ConfigMongoDB struct { Hostname string `json:"hostname"` Portnumber string `json:"port"` Username string `json:"username"` Password string `json:"password"` Database string `json:"database"` }
ConfigMongoDB defines the variables and types.
func LoadMongoProperty ¶
func LoadMongoProperty(fullFileName string) ConfigMongoDB
LoadMongoProperty reads and parses the JSON file that contain a MongoDB instance's credentials. It returns all the properties embedded in a configuration 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.
type MongoReader ¶
type MongoReader struct {
// contains filtered or unexported fields
}
MongoReader implements an io.Reader interface
func ConnectToDB ¶
func ConnectToDB(configMongoDB ConfigMongoDB) *MongoReader
ConnectToDB will connect to a MongoDB instance based on the specified credentials. It returns a reference to an io.Reader with MongoDB instance information