storj

package
v0.0.0-...-6d9c22b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEBUG = false

DEBUG allows more detailed working to be exposed through the terminal.

Functions

func CloseProject

func CloseProject(uplink *uplink.Uplink, proj *uplink.Project, bucket *uplink.Bucket)

CloseProject closes bucket, project and uplink.

func ConnectStorjReadDownloadData

func ConnectStorjReadDownloadData(downloadConfigStorj DownloadConfigStorj, readFile *bytes.Reader, keyValue string) error

ConnectStorjReadDownloadData function downloads data from Storj

func ConnectUpload

func ConnectUpload(ctx context.Context, bucket *uplink.Bucket, data []byte, databaseName string, fileNamesDEBUG []string, configStorj ConfigStorj, err error) ([]string, bool)

ConnectUpload uploads the data to storj network.

func Debug

func Debug(bucket *uplink.Bucket, metaFileName string, configStorj ConfigStorj, lastFileName string)

Debug function downloads the data from storj bucket after upload to verify data is uploaded successfully.

Types

type ConfigStorj

type ConfigStorj struct {
	APIKey               string `json:"apiKey"`
	Satellite            string `json:"satelliteURL"`
	Bucket               string `json:"bucketName"`
	UploadPath           string `json:"uploadPath"`
	EncryptionPassphrase string `json:"encryptionPassphrase"`
	SerializedScope      string `json:"serializedScope"`
	Key                  string `json:"key"`
	DisallowReads        string `json:"disallowReads"`
	DisallowWrites       string `json:"disallowWrites"`
	DisallowDeletes      string `json:"disallowDeletes"`
}

ConfigStorj depicts keys to search for within the stroj_config.json file.

func ConnectStorjReadUploadData

func ConnectStorjReadUploadData(fullFileName string, keyValue string, restrict string) (context.Context, *uplink.Uplink, *uplink.Project, *uplink.Bucket, ConfigStorj, string, error)

ConnectStorjReadUploadData reads Storj configuration from given file, connects to the desired Storj network. It then reads data property from an external file.

func LoadStorjConfiguration

func LoadStorjConfiguration(fullFileName string) (ConfigStorj, error)

LoadStorjConfiguration reads and parses the JSON file that contain Storj configuration information.

type DownloadConfigStorj

type DownloadConfigStorj struct {
	HostName             string `json:"hostName"`
	Port                 string `json:"port"`
	FileHash             string `json:"shareableHash"`
	DownloadPath         string `json:"downloadPath"`
	APIKey               string `json:"apiKey"`
	SatelliteURL         string `json:"satelliteURL"`
	EncryptionPassphrase string `json:"encryptionPassphrase"`
	SerializedScope      string `json:"serializedScope"`
	Key                  string `json:"key"`
}

DownloadConfigStorj structure to store data from json file

func DownloadStorjConfiguration

func DownloadStorjConfiguration(fullFileName string) (DownloadConfigStorj, error)

DownloadStorjConfiguration reads and parses the JSON file that contain Storj configuration information.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL