storage

package
v0.0.0-...-412bf38 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package storage wraps two bit casks as the disk-backed key-value store for sample information and run information

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

Storage holds a bitcask db and some extra stuff

func OpenStorage

func OpenStorage(dbLocation string) (*Storage, error)

OpenStorage will create/open up the databases and return a storage struct or an error

func (*Storage) AddRun

func (storage *Storage) AddRun(run *records.Run) error

AddRun is a method to marshal an run and store it

func (*Storage) AddSample

func (storage *Storage) AddSample(sample *records.Sample) error

AddSample is a method to marshal a sample and store it

func (*Storage) CloseStorage

func (storage *Storage) CloseStorage() error

CloseStorage will flush and close the storage databases

func (*Storage) DeleteRun

func (storage *Storage) DeleteRun(runName string) error

DeleteRun is a method to remove an run from storage

func (*Storage) DeleteSample

func (storage *Storage) DeleteSample(sampleLabel string) error

DeleteSample is a method to remove a sample from storage

func (*Storage) GetNumRuns

func (storage *Storage) GetNumRuns() int

GetNumRuns returns the current number of runs in storage

func (*Storage) GetNumSamples

func (storage *Storage) GetNumSamples() int

GetNumSamples returns the current number of samples in storage

func (*Storage) GetRun

func (storage *Storage) GetRun(runName string) (*records.Run, error)

GetRun is a method to retrieve an run from storage and unmarshal it to a struct

func (*Storage) GetRunLabels

func (storage *Storage) GetRunLabels() chan []byte

GetRunLabels returns a channel of run names (keys) held in storage

func (*Storage) GetSample

func (storage *Storage) GetSample(sampleLabel string) (*records.Sample, error)

GetSample is a method to retrieve a sample from storage and unmarshal it to a struct

func (*Storage) GetSampleJSONDump

func (storage *Storage) GetSampleJSONDump(sampleLabel string) (string, error)

GetSampleJSONDump is a method to retrieve a sample from storage and return a string dump of the protobuf message in JSON

func (*Storage) GetSampleLabels

func (storage *Storage) GetSampleLabels() chan []byte

GetSampleLabels returns a channel of sample labels (keys) held in storage

func (*Storage) GetSampleProtoDump

func (storage *Storage) GetSampleProtoDump(sampleLabel string) (string, error)

GetSampleProtoDump is a method to retrieve a sample from storage and return a string dump of the protobuf message

func (*Storage) Wipe

func (storage *Storage) Wipe() error

Wipe clears all entries from the samples and runs databases

Jump to

Keyboard shortcuts

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