store

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main()

Main doet niks

Types

type DownloadManager

type DownloadManager struct {
	ToDownload chan transmit.Serializable // data.RemoteFragmentDesc
	Completed  chan transmit.Serializable // data.LocalFragmentDesc
	Client     *minio.Client
}

DownloadManager is the structure that consumes RemoteFragmentDesc structures and downloads them

func NewDownloadManager

func NewDownloadManager(toDownload, completed chan transmit.Serializable) DownloadManager

NewDownloadManager creates a new downloadmanager and initiates a client of the Minio service

func (DownloadManager) Start

func (dm DownloadManager) Start(wg *sync.WaitGroup)

Start asychronously calls StartBlocking via a Goroutine

func (DownloadManager) StartBlocking

func (dm DownloadManager) StartBlocking()

StartBlocking enters an endless loop consuming RemoteFragmentDescs and downloading the associated data

type Downloader

type Downloader struct {
	Completed          map[string]string          // maps the name to the LocalPath, "" means undownloaded
	NotifyComplete     chan data.LocalFileDesc    // Channel to notify downloader of individual file completion
	NotifyManager      chan transmit.Serializable // Channel to notify download_manager of fragment completion
	DownloadDescriptor data.RemoteFragmentDesc
	Client             *minio.Client
	Folder             string
}

Downloader is a struct responsible for downloading a single fragment to local disk

func NewDownloader

func NewDownloader(msg data.RemoteFragmentDesc, client *minio.Client, manager chan transmit.Serializable, targetFolder string) Downloader

NewDownloader creates a new Downloader instance that will download teh pass fragment description

func (Downloader) IsComplete

func (d Downloader) IsComplete() bool

IsComplete checks whether all downloads have completed

func (Downloader) Start

func (d Downloader) Start(wg *sync.WaitGroup)

Start enters an loop that downloads all files via the client in goroutines

type UploadManager

type UploadManager struct {
	ToUpload  chan transmit.Serializable // data.LocalFragmentDesc
	Completed chan transmit.Serializable // data.RemoteFragmentDesc
	Client    *minio.Client
	Bucket    string
}

UploadManager is the structure that consumes LocalFragmentDesc structures and uploads them to minio

func NewUploadManager

func NewUploadManager(toUpload, completed chan transmit.Serializable) UploadManager

NewUploadManager creates a new upload manager and initiates a client of the Minio service

func (UploadManager) Start

func (um UploadManager) Start(wg *sync.WaitGroup)

Start asychronously calls StartBlocking via a Goroutine

func (UploadManager) StartBlocking

func (um UploadManager) StartBlocking()

StartBlocking enters an endless loop consuming LocalFragmentDesc and uploading the associated data

type Uploader

type Uploader struct {
	Completed        map[string]string          // maps the name to the LocalPath, "" means unuploaded
	NotifyComplete   chan data.RemoteFileDesc   // Channel to notify uploader of individual file completion
	NotifyManager    chan transmit.Serializable // Channel to notify upload_manager of fragment completion
	UploadDescriptor data.LocalFragmentDesc
	Client           *minio.Client
	Bucket           string
}

Uploader is a struct responsible for uploading a single fragment to the minio client

func NewUploader

func NewUploader(msg data.LocalFragmentDesc, client *minio.Client, manager chan transmit.Serializable, targetBucket string) Uploader

NewUploader creates a new Uploader instance that will upload the passed fragment description

func (Uploader) IsComplete

func (u Uploader) IsComplete() bool

IsComplete checks whether all uploads have completed

func (Uploader) Start

func (u Uploader) Start(wg *sync.WaitGroup)

Start enters an loop that uploads all files via the client in goroutines

Jump to

Keyboard shortcuts

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