pools

package
v0.34.0-test1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExists   = errors.New("pool already exists")
	ErrNotFound = errors.New("pool not found")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Ts         nano.Ts      `zed:"ts"`
	Name       string       `zed:"name"`
	ID         ksuid.KSUID  `zed:"id"`
	Layout     order.Layout `zed:"layout"`
	SeekStride int          `zed:"seek_stride"`
	Threshold  int64        `zed:"threshold"`
}

func NewConfig

func NewConfig(name string, layout order.Layout, thresh int64, seekStride int) *Config

func (*Config) Key

func (p *Config) Key() string

func (*Config) Path

func (p *Config) Path(root *storage.URI) *storage.URI

type Store

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

func CreateStore

func CreateStore(ctx context.Context, engine storage.Engine, path *storage.URI) (*Store, error)

func OpenStore

func OpenStore(ctx context.Context, engine storage.Engine, path *storage.URI) (*Store, error)

func (*Store) Add

func (s *Store) Add(ctx context.Context, config *Config) error

func (*Store) All

func (s *Store) All(ctx context.Context) ([]Config, error)

func (*Store) LookupByID

func (s *Store) LookupByID(ctx context.Context, id ksuid.KSUID) (*Config, error)

func (*Store) LookupByName

func (s *Store) LookupByName(ctx context.Context, name string) *Config

func (*Store) Remove

func (s *Store) Remove(ctx context.Context, config Config) error

Remove deletes a pool from the configuration journal.

func (*Store) Rename

func (s *Store) Rename(ctx context.Context, id ksuid.KSUID, newName string) error

Jump to

Keyboard shortcuts

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