localdiskstore

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: 12 Imported by: 0

Documentation

Overview

Package localdiskstore is a archive.Store compatible abstraction over the golang standard library for os-agnostic path resolution and disk io.

Index

Constants

View Source
const Name = "localDisk"

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 {
	RootPath string
}

Store implements archive.Store backed by local disk.

func New

func New(rootPath string) *Store

New returns a reference to a Store instance.

func NewFromConfig

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

NewFromConfig instantiates a Store using configuration values that were likely sourced from a configuration file target.

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(_ context.Context, name string) error

Delete removes an object in storage by name.

func (*Store) Get

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

Get finds an object in storage by name.

func (*Store) Put

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

Put writes the content of a supplied reader to local disk.

func (*Store) Search

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

Search finds matching files in storage by prefix.

func (*Store) Stat

func (s *Store) Stat(_ context.Context, search 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