output

package
v0.3.0-5 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archive

type Archive interface {
	Archive(name string, store Store) error
}

Archive is an interface to converting an output store to a portable format, such as a gzipped tar file.

type DirectoryStore

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

DirectoryStore is an output store implementation that stores outputs as files in a given directory.

func NewDirectoryStore

func NewDirectoryStore(directory string) *DirectoryStore

NewDirectoryStore instantiates a new DirectoryStore struct

func (*DirectoryStore) Cleanup

func (dirStore *DirectoryStore) Cleanup() error

Cleanup removes the directory and files used for this output store

func (*DirectoryStore) Items

func (dirStore *DirectoryStore) Items() ([]StoreItem, error)

Items returns the collection of outputs store in this directory

func (*DirectoryStore) Save

func (dirStore *DirectoryStore) Save(name string, reader io.Reader) error

Save stores a given output to the directory as a file

type DirectoryStoreItem

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

DirectoryStoreItem is a reference to a file stored in a DirectoryStore

func (*DirectoryStoreItem) Info

func (item *DirectoryStoreItem) Info() (os.FileInfo, error)

Info returns the stat results for a given item (file) in a DirectoryStore

func (*DirectoryStoreItem) Open

func (item *DirectoryStoreItem) Open() (io.Reader, func() error, error)

Open returns the io.Reader to the file for the DirectoryStoreItem

type Store

type Store interface {
	Save(name string, reader io.Reader) error
	Items() ([]StoreItem, error)
	Cleanup() error
}

Store represent an object that can save raw outputs, referencing them by name.

type StoreItem

type StoreItem interface {
	Info() (fs.FileInfo, error)
	Open() (reader io.Reader, cleanup func() error, err error)
}

StoreItem represents a particular raw output that has been saved to a Store.

type TarGzipArchive

type TarGzipArchive struct {
	OutputDir string
}

TarGzipArchive archives an output store as a Gzipped Tar archive.

func (*TarGzipArchive) Archive

func (archive *TarGzipArchive) Archive(
	name string,
	store Store,
) error

Archive writes the gzipped tar archive for the given Store using the provided name.

Jump to

Keyboard shortcuts

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