storage

package
v0.0.0-...-9de77ed Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Descriptor

type Descriptor[Reference any] interface {
	// Reference is the type used by the storage solution
	// to be able to reference the benchmark.
	Reference() Reference
	// Benchmark is the value provided
	Benchmark() result.Benchmark
}

Descriptor allows for storage solutions to define how to reference the returned benchmark in future.

func NewDescriptor

func NewDescriptor[Reference any](ref Reference, bench result.Benchmark) Descriptor[Reference]

type Option

type Option[Reference any] interface {
	Apply(Storage[Reference]) error
}

type OptionFunc

type OptionFunc[Reference any] func(s Storage[Reference]) error

func (OptionFunc[Reference]) Apply

func (of OptionFunc[Reference]) Apply(s Storage[Reference]) error

type Storage

type Storage[Reference any] interface {
	// Init creates any required entries or structures for the storage type
	Init(ctx context.Context) error

	// Create takes the benchmark results and stores it to the storage
	// solution returning the storage descriptor or an error.
	Create(ctx context.Context, bench ...result.Benchmark) ([]Descriptor[Reference], error)

	// Update modifies the reference with exact value provided.
	Update(ctx context.Context, references ...Descriptor[Reference]) error

	// Delete removes the references from the storage
	Delete(ctx context.Context, references ...Descriptor[Reference]) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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