reader

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package reader provides the reader functions for handling with s3. This package is wrapping package of "https://github.com/aws/aws-sdk-go".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockIO added in v0.0.58

type MockIO struct {
	NewReaderWithContextFunc     func(ctx context.Context, r io.Reader) (io.Reader, error)
	NewReadCloserWithContextFunc func(ctx context.Context, r io.ReadCloser) (io.ReadCloser, error)
}

MockIO represents mock for io.IO.

func (*MockIO) NewReadCloserWithContext added in v0.0.58

func (m *MockIO) NewReadCloserWithContext(ctx context.Context, r io.ReadCloser) (io.ReadCloser, error)

NewReadCloserWithContext calls NewReadCloserWithContextFunc.

func (*MockIO) NewReaderWithContext added in v0.0.58

func (m *MockIO) NewReaderWithContext(ctx context.Context, r io.Reader) (io.Reader, error)

NewReaderWithContext calls NewReaderWithContextFunc.

type MockReadCloser added in v0.0.58

type MockReadCloser struct {
	ReadFunc  func(p []byte) (n int, err error)
	CloseFunc func() error
}

MockReadCloser represents mock for io.ReadCloser.

func (*MockReadCloser) Close added in v0.0.58

func (m *MockReadCloser) Close() error

Close calls CloseFunc.

func (*MockReadCloser) Read added in v0.0.58

func (m *MockReadCloser) Read(p []byte) (n int, err error)

Read calls ReadFunc.

type MockReader added in v0.0.63

type MockReader struct {
	OpenFunc  func(ctx context.Context, key string) error
	ReadFunc  func(p []byte) (n int, err error)
	CloseFunc func() error
}

MockReader represents mock for Reader.

func (*MockReader) Close added in v0.0.63

func (m *MockReader) Close() error

Close calls CloseFunc.

func (*MockReader) Open added in v0.0.63

func (m *MockReader) Open(ctx context.Context, key string) error

Open calls OpenFunc.

func (*MockReader) Read added in v0.0.63

func (m *MockReader) Read(p []byte) (n int, err error)

Read calls ReadFunc.

type MockS3API added in v0.0.58

type MockS3API struct {
	s3iface.S3API
	GetObjectWithContextFunc func(aws.Context, *s3.GetObjectInput, ...request.Option) (*s3.GetObjectOutput, error)
}

MockS3API represents mock for s3iface.MMockS3API.

func (*MockS3API) GetObjectWithContext added in v0.0.58

func (m *MockS3API) GetObjectWithContext(ctx aws.Context, in *s3.GetObjectInput, opts ...request.Option) (*s3.GetObjectOutput, error)

GetObjectWithContext calls GetObjectWithContextFunc.

type Option

type Option func(r *reader)

Option represents the functional option for reader.

func WithBackoff added in v0.0.43

func WithBackoff(enabled bool) Option

WithBackoff returns the option to set the backoffEnabled.

func WithBackoffOpts added in v0.0.43

func WithBackoffOpts(opts ...backoff.Option) Option

WithBackoffOpts returns the option to set the backoffOpts.

func WithBucket

func WithBucket(bucket string) Option

WithBucket returns the option to set the bucket.

func WithErrGroup added in v0.0.41

func WithErrGroup(eg errgroup.Group) Option

WithErrGroup returns the option to set the eg.

func WithMaxChunkSize added in v0.0.43

func WithMaxChunkSize(size int64) Option

WithMaxChunkSize retunrs the option to set the maxChunkSize.

func WithService

func WithService(s s3iface.S3API) Option

WithService returns the option to set the service.

type Reader

type Reader interface {
	Open(ctx context.Context, key string) error
	io.ReadCloser
}

Reader is an interface that groups the basic Read and Close and Open methods.

func New

func New(opts ...Option) (Reader, error)

New returns Reader implementation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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