metadata

package
v0.8.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: Apache-2.0 Imports: 7 Imported by: 362

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSkipSetValue = errors.New("skip setting metadata value")

Functions

This section is empty.

Types

type StorageItem

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

func (*StorageItem) Commit

func (s *StorageItem) Commit() error

func (*StorageItem) Get

func (s *StorageItem) Get(k string) *Value

func (*StorageItem) GetAndSetValue added in v0.8.0

func (s *StorageItem) GetAndSetValue(key string, fn func(*Value) (*Value, error)) error

func (*StorageItem) GetExternal

func (s *StorageItem) GetExternal(k string) ([]byte, error)

func (*StorageItem) ID

func (s *StorageItem) ID() string

func (*StorageItem) Indexes

func (s *StorageItem) Indexes() (out []string)

func (*StorageItem) Keys

func (s *StorageItem) Keys() []string

func (*StorageItem) Metadata added in v0.6.0

func (s *StorageItem) Metadata() *StorageItem

func (*StorageItem) Queue

func (s *StorageItem) Queue(fn func(b *bolt.Bucket) error)

func (*StorageItem) SetExternal

func (s *StorageItem) SetExternal(k string, dt []byte) error

func (*StorageItem) SetValue

func (s *StorageItem) SetValue(b *bolt.Bucket, key string, v *Value) error

func (*StorageItem) Storage

func (s *StorageItem) Storage() *Store

func (*StorageItem) Update

func (s *StorageItem) Update(fn func(b *bolt.Bucket) error) error

func (*StorageItem) View

func (s *StorageItem) View(fn func(b *bolt.Bucket) error) error

type Store

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

func NewStore

func NewStore(dbPath string) (*Store, error)

func (*Store) All

func (s *Store) All() ([]*StorageItem, error)

func (*Store) Clear

func (s *Store) Clear(id string) error

func (*Store) Close

func (s *Store) Close() error

func (*Store) DB

func (s *Store) DB() *bolt.DB

func (*Store) Get

func (s *Store) Get(id string) (*StorageItem, bool)

func (*Store) Probe

func (s *Store) Probe(index string) (bool, error)

func (*Store) Search

func (s *Store) Search(index string) ([]*StorageItem, error)

func (*Store) Update

func (s *Store) Update(id string, fn func(b *bolt.Bucket) error) error

func (*Store) View

func (s *Store) View(id string, fn func(b *bolt.Bucket) error) error

type Value

type Value struct {
	Value json.RawMessage `json:"value,omitempty"`
	Index string          `json:"index,omitempty"`
}

func NewValue

func NewValue(v interface{}) (*Value, error)

func (*Value) Unmarshal

func (v *Value) Unmarshal(target interface{}) error

Jump to

Keyboard shortcuts

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