tinytable

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CF

type CF[T any] struct {
	// contains filtered or unexported fields
}

func (*CF[T]) Delete

func (f *CF[T]) Delete(k string) bool

func (*CF[T]) Every

func (f *CF[T]) Every(t Iterator[T])

func (*CF[T]) Get

func (f *CF[T]) Get(k string) (T, bool)

func (*CF[T]) Prefix

func (f *CF[T]) Prefix(prefix string, t Iterator[T])

func (*CF[T]) Put

func (f *CF[T]) Put(k string, v T)

func (*CF[T]) Range

func (f *CF[T]) Range(start, end string, t Iterator[T])

type Config added in v0.3.0

type Config struct {
	Debug int
}

func ConfigFromEnv added in v0.3.0

func ConfigFromEnv() Config

func ConfigFromOptions added in v0.3.0

func ConfigFromOptions(opts ...Option) Config

type Iterator

type Iterator[T any] func(string, T) bool

type Option added in v0.3.0

type Option func(c Config) Config

func Debug added in v0.3.0

func Debug(n int) Option

type Row

type Row[T any] struct {
	Key string
	Val T
}

type Table

type Table[T any] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New[T any](opts ...Option) *Table[T]

func NewWithConfig added in v0.3.0

func NewWithConfig[T any](conf Config) *Table[T]

func Read added in v0.2.0

func Read[T any](r io.Reader) (*Table[T], error)

Read a snapshot of a table from the specified reader.

func (*Table[T]) CF

func (t *Table[T]) CF(name string) *CF[T]

func (*Table[T]) Write added in v0.2.0

func (t *Table[T]) Write(w io.Writer) error

Write a snapshot of a table to the specified writer.

Jump to

Keyboard shortcuts

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