versioned

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map[T proto.Message] struct {
	// contains filtered or unexported fields
}

Map is a simple, versioned, map.

func NewMap

func NewMap[T proto.Message]() *Map[T]

func (*Map[T]) Read

func (m *Map[T]) Read(ctx context.Context, key string, version string) (T, string, error)

Read gets the value and the version associated with a key.

If version is the empty string, then read gets the latest value of the key, along with its version; otherwise it blocks until the latest value of the key is newer than the provided version.

func (*Map[T]) Update

func (m *Map[T]) Update(key string, value T) string

Update (over)writes the value for a key with value.

Jump to

Keyboard shortcuts

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