s3client

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AWSCLIError = errs.Class("aws-cli error")

AWSCLIError is class for minio errors

View Source
var MinioError = errs.Class("minio error")

MinioError is class for minio errors

View Source
var UplinkError = errs.Class("uplink error")

UplinkError is class for minio errors

Functions

This section is empty.

Types

type AWSCLI

type AWSCLI struct {
	// contains filtered or unexported fields
}

AWSCLI implements basic S3 Client with aws-cli

func (*AWSCLI) Delete

func (client *AWSCLI) Delete(bucket, objectName string) error

Delete deletes object

func (*AWSCLI) Download

func (client *AWSCLI) Download(bucket, objectName string, buffer []byte) ([]byte, error)

Download downloads object data

func (*AWSCLI) ListBuckets

func (client *AWSCLI) ListBuckets() ([]string, error)

ListBuckets lists all buckets

func (*AWSCLI) ListObjects

func (client *AWSCLI) ListObjects(bucket, prefix string) ([]string, error)

ListObjects lists objects

func (*AWSCLI) MakeBucket

func (client *AWSCLI) MakeBucket(bucket, location string) error

MakeBucket makes a new bucket

func (*AWSCLI) RemoveBucket

func (client *AWSCLI) RemoveBucket(bucket string) error

RemoveBucket removes a bucket

func (*AWSCLI) Upload

func (client *AWSCLI) Upload(bucket, objectName string, data []byte) error

Upload uploads object data to the specified path

func (*AWSCLI) UploadMultipart

func (client *AWSCLI) UploadMultipart(bucket, objectName string, data []byte, threshold int) error

UploadMultipart uses multipart uploads, has hardcoded threshold

type Client

type Client interface {
	MakeBucket(bucket, location string) error
	RemoveBucket(bucket string) error
	ListBuckets() ([]string, error)

	Upload(bucket, objectName string, data []byte) error
	Download(bucket, objectName string, buffer []byte) ([]byte, error)
	Delete(bucket, objectName string) error
	ListObjects(bucket, prefix string) ([]string, error)
}

Client is the common interface for different implementations

func NewAWSCLI

func NewAWSCLI(conf Config) (Client, error)

NewAWSCLI creates new Client

func NewMinio

func NewMinio(conf Config) (Client, error)

NewMinio creates new Client

func NewUplink(conf Config) (Client, error)

NewUplink creates new Client

type Config

type Config struct {
	S3Gateway     string
	Satellite     string
	AccessKey     string
	SecretKey     string
	APIKey        string
	EncryptionKey string
	NoSSL         bool
	ConfigDir     string
}

Config is the setup for a particular client

type Minio

type Minio struct {
	// contains filtered or unexported fields
}

Minio implements basic S3 Client with minio

func (*Minio) Delete

func (client *Minio) Delete(bucket, objectName string) error

Delete deletes object

func (*Minio) Download

func (client *Minio) Download(bucket, objectName string, buffer []byte) ([]byte, error)

Download downloads object data

func (*Minio) ListBuckets

func (client *Minio) ListBuckets() ([]string, error)

ListBuckets lists all buckets

func (*Minio) ListObjects

func (client *Minio) ListObjects(bucket, prefix string) ([]string, error)

ListObjects lists objects

func (*Minio) MakeBucket

func (client *Minio) MakeBucket(bucket, location string) error

MakeBucket makes a new bucket

func (*Minio) RemoveBucket

func (client *Minio) RemoveBucket(bucket string) error

RemoveBucket removes a bucket

func (*Minio) Upload

func (client *Minio) Upload(bucket, objectName string, data []byte) error

Upload uploads object data to the specified path

func (*Minio) UploadMultipart

func (client *Minio) UploadMultipart(bucket, objectName string, data []byte, threshold int) error

UploadMultipart uses multipart uploads, has hardcoded threshold

type Uplink struct {
	// contains filtered or unexported fields
}

Uplink implements basic S3 Client with uplink

func (*Uplink) Delete

func (client *Uplink) Delete(bucket, objectName string) error

Delete deletes object

func (*Uplink) Download

func (client *Uplink) Download(bucket, objectName string, buffer []byte) ([]byte, error)

Download downloads object data

func (*Uplink) ListBuckets

func (client *Uplink) ListBuckets() ([]string, error)

ListBuckets lists all buckets

func (*Uplink) ListObjects

func (client *Uplink) ListObjects(bucket, prefix string) ([]string, error)

ListObjects lists objects

func (*Uplink) MakeBucket

func (client *Uplink) MakeBucket(bucket, location string) error

MakeBucket makes a new bucket

func (*Uplink) RemoveBucket

func (client *Uplink) RemoveBucket(bucket string) error

RemoveBucket removes a bucket

func (*Uplink) Upload

func (client *Uplink) Upload(bucket, objectName string, data []byte) error

Upload uploads object data to the specified path

Jump to

Keyboard shortcuts

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