s3io

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidS3Path = errors.New("path is not a valid s3 location")

Functions

func Exists

func Exists(ctx context.Context, path string, client s3iface.S3API) (bool, error)

func IsS3Path

func IsS3Path(path string) bool

func NewClient

func NewClient(cfg *aws.Config) *s3.S3

func ReadFile

func ReadFile(ctx context.Context, path string, client s3iface.S3API) ([]byte, error)

func Remove

func Remove(ctx context.Context, path string, client s3iface.S3API) error

func RemoveAll

func RemoveAll(ctx context.Context, path string, client s3iface.S3API) error

Types

type Info

type Info struct {
	Name    string
	Size    int64
	ModTime time.Time
	IsDir   bool
}

func List

func List(ctx context.Context, path string, client s3iface.S3API) ([]Info, error)

func Stat

func Stat(ctx context.Context, uri string, client s3iface.S3API) (Info, error)

type Reader

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

func NewReader

func NewReader(ctx context.Context, path string, client s3iface.S3API) (*Reader, error)

func (*Reader) Close

func (r *Reader) Close() error

func (*Reader) Read

func (r *Reader) Read(p []byte) (int, error)

func (*Reader) ReadAt

func (r *Reader) ReadAt(p []byte, off int64) (int, error)

func (*Reader) Seek

func (r *Reader) Seek(offset int64, whence int) (int64, error)

func (*Reader) Size

func (r *Reader) Size() (int64, error)

type Replacer

type Replacer struct {
	*Writer
}

func NewReplacer

func NewReplacer(ctx context.Context, path string, client s3iface.S3API, options ...func(*s3manager.Uploader)) (*Replacer, error)

func (*Replacer) Abort

func (r *Replacer) Abort()

func (*Replacer) Close

func (r *Replacer) Close() error

type Writer

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

func NewWriter

func NewWriter(ctx context.Context, path string, client s3iface.S3API, options ...func(*s3manager.Uploader)) (*Writer, error)

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) Write

func (w *Writer) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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