s3

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultReadWriter

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

DefaultReadWriter the default S3ReadWrite implementation

func (*DefaultReadWriter) GetLatestKeyForID

func (s *DefaultReadWriter) GetLatestKeyForID(id string) (string, error)

GetLatestKeyForID lists s3 objects in the folder for the given ID

func (*DefaultReadWriter) Ping

func (s *DefaultReadWriter) Ping() error

Ping checks whether an S3 session has been initialised

func (*DefaultReadWriter) Read

func (s *DefaultReadWriter) Read(key string) (bool, io.ReadCloser, *string, error)

Read reads the provided key and returns a reader etc.

func (*DefaultReadWriter) Write

func (s *DefaultReadWriter) Write(id string, key string, b []byte, contentType string) error

Write writes the given ID to S3

type MockReadWriter added in v0.2.12

type MockReadWriter struct {
	mock.Mock
}

func (*MockReadWriter) GetLatestKeyForID added in v0.2.12

func (m *MockReadWriter) GetLatestKeyForID(id string) (string, error)

func (*MockReadWriter) Ping added in v0.2.12

func (m *MockReadWriter) Ping() error

func (*MockReadWriter) Read added in v0.2.12

func (m *MockReadWriter) Read(key string) (bool, io.ReadCloser, *string, error)

func (*MockReadWriter) Write added in v0.2.12

func (m *MockReadWriter) Write(id string, key string, b []byte, contentType string) error

type ReadWriter

type ReadWriter interface {
	Write(id string, key string, b []byte, contentType string) error
	Read(key string) (bool, io.ReadCloser, *string, error)
	GetLatestKeyForID(id string) (string, error)
	Ping() error
}

ReadWriter is responsible for reading, writing and locating the latest cycle restore files from S3

func NewReadWriter

func NewReadWriter(region string, bucketName string) ReadWriter

NewReadWriter create a new S3 R/W for the given region and bucket

Jump to

Keyboard shortcuts

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