storage

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 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 S3

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

S3 is a type for working with S3 storages

func NewS3

func NewS3(endpoint, accessKeyID, secretAccessKey, bucketName, prefix, region string, useSSL bool) (*S3, error)

NewS3 return new Manager, useSSL using ssl for connection with storage

func (*S3) GetObject

func (s *S3) GetObject(objectName string) (io.Reader, error)

GetObject return content by given object name

func (*S3) ListObjects

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

func (*S3) PutObject

func (s *S3) PutObject(name string, data io.Reader, size int64) error

PutObject puts new object to storage with given name and content

type Storage

type Storage interface {
	GetObject(objectName string) (io.Reader, error)
	PutObject(name string, data io.Reader, size int64) error
	ListObjects(prefix string) ([]string, error)
}

Jump to

Keyboard shortcuts

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