metadata

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NameMemory = "memory"
)

Variables

View Source
var (
	ErrUnknownMetadataName = errors.New("unknown metadata name")
	ErrInvalidVersion      = errors.New("invalid version")
	ErrNotFound            = errors.New("not found")
)

Functions

This section is empty.

Types

type Memory

type Memory struct {
	sync.WaitGroup
	// contains filtered or unexported fields
}

func (*Memory) Clean

func (m *Memory) Clean() error

func (*Memory) Close

func (m *Memory) Close() error

func (*Memory) Delete

func (m *Memory) Delete(key []byte, cb callback.Callback[any])

func (*Memory) DeleteAll

func (m *Memory) DeleteAll(parentKey []byte, cb callback.Callback[any])

func (*Memory) Get

func (m *Memory) Get(key []byte, cb callback.Callback[*proto.Meta])

func (*Memory) ListChildren

func (m *Memory) ListChildren(parentKey []byte, callback callback.Callback[[]string])

func (*Memory) Notification

func (m *Memory) Notification() <-chan *proto.MetaNotification

func (*Memory) Put

func (m *Memory) Put(key []byte, value []byte, ephemeral bool, callback callback.Callback[*proto.MetaInfo])

func (*Memory) Swap

func (m *Memory) Swap(key []byte, value []byte, ephemeral bool, expectVersion int64, cb callback.Callback[*proto.MetaInfo])

type Metadata

type Metadata interface {
	io.Closer
	lifecycle.Cleanup

	Put(key []byte, value []byte, ephemeral bool, cb callback.Callback[*proto.MetaInfo])

	Swap(key []byte, value []byte, ephemeral bool, expectVersion int64, cb callback.Callback[*proto.MetaInfo])

	Get(key []byte, cb callback.Callback[*proto.Meta])

	Delete(key []byte, cb callback.Callback[any])

	ListChildren(parentKey []byte, cb callback.Callback[[]string])

	DeleteAll(parentKey []byte, cb callback.Callback[any])

	Notification() <-chan *proto.MetaNotification
}

func NewMemoryMetadata

func NewMemoryMetadata(ctx context.Context) Metadata

func NewMetadata

func NewMetadata(ctx context.Context, option Options) (Metadata, error)

type Options

type Options struct {
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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