client

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// WriteObject stores a single object
	WriteObject(bucket, objectKey, data, contentType, contentEncoding string, metadata map[string]*string) error
	// ReadObject reads a single object
	ReadObject(bucket, objectKey string) ([]byte, error)
	// ListObjects lists objects withing a bucket
	ListObjects(bucket, prefix string) ([]*string, error)
}

Client allows uploading objects to an object storage service

func New

func New(endpoint, region, accessKey, secretKey string) Client

New creates a new S3-compatible object storage client

type S3Client

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

S3Client allows uploading objects to an S3-compatible object storage service

func (*S3Client) ListObjects

func (s *S3Client) ListObjects(bucket, prefix string) ([]*string, error)

ListObjects lists objects withing a bucket

func (*S3Client) ReadObject

func (s *S3Client) ReadObject(bucket, objectKey string) ([]byte, error)

ReadObject reads a single object

func (*S3Client) WriteObject

func (s *S3Client) WriteObject(bucket, objectKey, data, contentType, contentEncoding string, metadata map[string]*string) error

WriteObject stores a single object

Source Files

  • client.go

Jump to

Keyboard shortcuts

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