storage

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NopType = Type(iota)
	DiskType
)

Variables

View Source
var (
	ErrUnknownSampler = fmt.Errorf("unknown sampler")
)

Functions

This section is empty.

Types

type ConfigDocument added in v0.2.0

type ConfigDocument struct {
	Samplers []SamplerEntry
}

type Disk

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

func NewDisk

func NewDisk(path string) (*Disk, error)

func (*Disk) DeleteSampler added in v0.2.0

func (d *Disk) DeleteSampler(resource string, sampler string) error

func (*Disk) GetSampler added in v0.2.0

func (d *Disk) GetSampler(resource string, sampler string) (control.SamplerConfig, error)

func (*Disk) RangeSamplers added in v0.2.0

func (d *Disk) RangeSamplers(fn func(resource string, sampler string, config control.SamplerConfig)) error

func (*Disk) SetSampler added in v0.2.0

func (d *Disk) SetSampler(resource string, sampler string, config control.SamplerConfig) error

type Nop added in v0.1.0

type Nop struct {
}

func NewNop added in v0.1.0

func NewNop() *Nop

func (*Nop) DeleteSampler added in v0.2.0

func (d *Nop) DeleteSampler(_ string, _ string) error

func (*Nop) GetSampler added in v0.2.0

func (d *Nop) GetSampler(_ string, _ string) (control.SamplerConfig, error)

func (*Nop) RangeSamplers added in v0.2.0

func (d *Nop) RangeSamplers(_ func(resource string, sampler string, config control.SamplerConfig)) error

func (*Nop) SetSampler added in v0.2.0

func (d *Nop) SetSampler(_ string, _ string, _ control.SamplerConfig) error

type Options added in v0.1.0

type Options struct {
	// Type contains the backend used to store data
	Type Type
	// Path contains the root folder where the data will be stored
	Path string
}

func NewOptionsDefault added in v0.1.0

func NewOptionsDefault() *Options

type SamplerEntry added in v0.2.0

type SamplerEntry struct {
	Resource string
	Name     string
	Config   control.SamplerConfig
}

type Storage

type Storage interface {
	GetSampler(resource string, sampler string) (control.SamplerConfig, error)
	RangeSamplers(func(resource string, sampler string, config control.SamplerConfig)) error
	SetSampler(resource string, sampler string, config control.SamplerConfig) error
	DeleteSampler(resource string, sampler string) error
}

type Type added in v0.1.0

type Type int

Jump to

Keyboard shortcuts

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