s3backend

package
v0.1.3-beta Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2016 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package s3backend expose S3 interaction capabilities backended by the FileManager package. All operations are managed by a concurrent working queue and tend to be asyncronous.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {

	// exposed vars
	ErrorChan      chan error       // returned errors;
	UploadedChan   chan ct.OpResult // status of uploads;
	DownloadedChan chan ct.OpResult // return chan for async downloaded chunks;
	DeletedChan    chan ct.OpResult // manage deletion results from wq.
	// contains filtered or unexported fields
}

Session struct is composed of several private fields and expose the async mechanism chans.

func NewSession

func NewSession(endpoint, region, id, secret, token string, workersize, queuesize int, verbose bool) (*Session, error)

NewSession initialise a new S3 session for the file storage capabilities-

func (*Session) Close

func (bs *Session) Close()

Close close the actual opened connection with S3 storage, should normally be used with the defer keyword after invoking the NewSession function.

func (*Session) Delete

func (bs *Session) Delete(bucketName, id, requestid string)

Delete removes a identified file from a S3 storage bucket.

func (*Session) Download

func (bs *Session) Download(bucketName, id, requestid string)

Download get a single file from a S3 bucket.

func (*Session) Upload

func (bs *Session) Upload(bucketName, id, requestid string, data []byte, expires *time.Time)

Upload send a single data blob to a S3 storage.

Jump to

Keyboard shortcuts

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