objectstore

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "objectStore"

Name is used in the memorybox configuration file to determine which type of store to instantiate.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	Bucket   string
	S3       s3Backend
	Uploader s3Uploader
	Session  *session.Session
}

Store implements archive.Store backed by s3-compatible object archive.

func New

func New(bucket string, sess *session.Session) *Store

New returns a reference to a Store instance.

func NewFromConfig

func NewFromConfig(config map[string]string) *Store

NewFromConfig produces a new instance of a store.

func (*Store) Concat

func (s *Store) Concat(ctx context.Context, concurrency int, files []string) ([][]byte, error)

Concat an array of byte arrays ordered identically with the input files supplied. Note that this loads the entire dataset into memory.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, key string) error

Delete removes an object from archive.

func (*Store) Get

func (s *Store) Get(ctx context.Context, name string) (*file.File, error)

Get finds an object and its metadata in storage by name.

func (*Store) Put

func (s *Store) Put(ctx context.Context, reader io.Reader, name string, lastModified time.Time) error

Put writes the content of an io.Reader to the backing object storage bucket. It saves the actual lastModified time supplied as metadata because most s3 implementations do not allow modifying it.

func (*Store) Search

func (s *Store) Search(ctx context.Context, prefix string) (file.List, error)

Search finds an object in storage by prefix and returns an array of matches

func (*Store) Stat

func (s *Store) Stat(ctx context.Context, name string) (*file.File, error)

Stat gets details about an object in the store.

func (*Store) String

func (s *Store) String() string

String returns a human friendly representation of the Store.

Jump to

Keyboard shortcuts

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