prefixmatcher

package
v0.0.0-...-4fc5b5b Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NopReader

func NopReader[T any]() *prefixMatcher[T]

Types

type Builder

type Builder[T any] interface {
	// Add adds or updates the item with key to have value value.
	Add(key string, value T)
	Reader[T]
}

func NewMatcher

func NewMatcher[T any]() Builder[T]

type Reader

type Reader[T any] interface {
	Get(key string) (T, bool)
	LongestPrefix(key string) (string, T, bool)
	Empty() bool
	Keys() []string
}

type StringSetBuilder

type StringSetBuilder interface {
	Builder[map[string]struct{}]
}

StringSetReader is a builder designed specifially to contain a set of string values (ie: Builder[map[string]struct{}]). This is a quality-of-life typecast for the generic Builder.

type StringSetMatchBuilder

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

Items that should be excluded when sourcing data from the base backup. Parent Path -> item ID -> {}

func NewStringSetBuilder

func NewStringSetBuilder() *StringSetMatchBuilder

func (*StringSetMatchBuilder) Add

func (m *StringSetMatchBuilder) Add(key string, items map[string]struct{})

copies all items into the key's bucket.

func (*StringSetMatchBuilder) Empty

func (m *StringSetMatchBuilder) Empty() bool

func (*StringSetMatchBuilder) Get

func (m *StringSetMatchBuilder) Get(parent string) (map[string]struct{}, bool)

func (*StringSetMatchBuilder) Keys

func (m *StringSetMatchBuilder) Keys() []string

func (*StringSetMatchBuilder) LongestPrefix

func (m *StringSetMatchBuilder) LongestPrefix(parent string) (string, map[string]struct{}, bool)

func (*StringSetMatchBuilder) ToReader

func (m *StringSetMatchBuilder) ToReader() *StringSetMatcher

type StringSetMatcher

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

Items that should be excluded when sourcing data from the base backup. Parent Path -> item ID -> {}

func (*StringSetMatcher) Empty

func (m *StringSetMatcher) Empty() bool

func (*StringSetMatcher) Get

func (m *StringSetMatcher) Get(parent string) (map[string]struct{}, bool)

func (*StringSetMatcher) Keys

func (m *StringSetMatcher) Keys() []string

func (*StringSetMatcher) LongestPrefix

func (m *StringSetMatcher) LongestPrefix(parent string) (string, map[string]struct{}, bool)

type StringSetReader

type StringSetReader interface {
	Reader[map[string]struct{}]
}

StringSetReader is a reader designed specifially to contain a set of string values (ie: Reader[map[string]struct{}]). This is a quality-of-life typecast for the generic Reader.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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