s3

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const Name = "s3"

Name of the storage implementation.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App of package.

func New

func New(endpoint, accessKey, secretAccess, bucket string, useSSL bool, partSize uint64) (App, error)

New creates new App from Config.

func (App) ConvertError added in v0.3.4

func (a App) ConvertError(err error) error

ConvertError with the appropriate type.

func (App) CreateDir

func (a App) CreateDir(ctx context.Context, name string) error

CreateDir container in storage.

func (App) Enabled

func (a App) Enabled() bool

Enabled checks that requirements are met.

func (App) Info

func (a App) Info(ctx context.Context, pathname string) (model.Item, error)

Info provide metadata about given pathname.

func (App) List

func (a App) List(ctx context.Context, pathname string) ([]model.Item, error)

List items in the storage.

func (App) Name added in v0.0.3

func (a App) Name() string

Name of the sotrage.

func (App) Path added in v0.0.3

func (a App) Path(pathname string) string

Path return full path of pathname.

func (App) ReadFrom added in v0.1.0

func (a App) ReadFrom(ctx context.Context, pathname string) (io.ReadSeekCloser, error)

ReadFrom reads content from given pathname.

func (App) Remove

func (a App) Remove(ctx context.Context, pathname string) error

Remove file or directory from storage.

func (App) Rename

func (a App) Rename(ctx context.Context, oldName, newName string) error

Rename file or directory from storage.

func (App) UpdateDate

func (a App) UpdateDate(_ context.Context, _ string, _ time.Time) error

UpdateDate update date from given value.

func (App) Walk

func (a App) Walk(ctx context.Context, pathname string, walkFn func(model.Item) error) error

Walk browses item recursively.

func (App) WithIgnoreFn

func (a App) WithIgnoreFn(ignoreFn func(model.Item) bool) model.Storage

WithIgnoreFn create a new App with given ignoreFn.

func (App) WriteSizedTo added in v0.5.1

func (a App) WriteSizedTo(ctx context.Context, pathname string, size int64, reader io.Reader) error

WriteSizedTo with content from reader to pathname with known size.

func (App) WriteTo added in v0.1.0

func (a App) WriteTo(ctx context.Context, pathname string, reader io.Reader) error

WriteTo with content from reader to pathname.

Jump to

Keyboard shortcuts

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