storage

package
v0.0.0-...-0afbc09 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const FileSystemStorageExtension string = ".bench"

FileSystemStorageExtension specifies the extension for stored files

Variables

View Source
var ErrInvalidStorageDriver = errors.New("storage driver missing or unknown")

ErrInvalidStorageDriver when a unknown driver is specified

Functions

This section is empty.

Types

type Driver

type Driver string

Driver is used to queue asynchronous requests by a delegate middleware

const (
	FileSystemDriver    Driver = "file"
	ElasticSearchDriver Driver = "elastic"
)

Storage drivers

type ElasticSearch

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

ElasticSearch struct representation

func NewElasticSearchStorage

func NewElasticSearchStorage(url string, prefix string) *ElasticSearch

NewElasticSearchStorage driver

func (*ElasticSearch) GetLatest

func (es *ElasticSearch) GetLatest() (*executor.Result, error)

GetLatest stored results

func (*ElasticSearch) Persist

func (es *ElasticSearch) Persist(r *executor.Result) error

Persist results

type FileSystem

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

FileSystem struct representation

func NewFileSytemStorage

func NewFileSytemStorage(destination string, group string) (*FileSystem, error)

NewFileSytemStorage driver

func (*FileSystem) GetLatest

func (fs *FileSystem) GetLatest() (*executor.Result, error)

GetLatest stored results

func (*FileSystem) Persist

func (fs *FileSystem) Persist(r *executor.Result) error

Persist results

type Storage

type Storage interface {
	GetLatest() (*executor.Result, error)
	Persist(r *executor.Result) error
}

Storage represents a storage driver

func New

func New(group string, driver string, destination string) (Storage, error)

New returns new driver instance dependening on selected driver

Jump to

Keyboard shortcuts

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