stringcache

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainedGroupedCache

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

func NewChainedGroupedCache

func NewChainedGroupedCache(caches ...GroupedStringCache) *ChainedGroupedCache

func (*ChainedGroupedCache) Contains

func (c *ChainedGroupedCache) Contains(searchString string, groups []string) []string

func (*ChainedGroupedCache) ElementCount

func (c *ChainedGroupedCache) ElementCount(group string) int

func (*ChainedGroupedCache) Refresh

func (c *ChainedGroupedCache) Refresh(group string) GroupFactory

type GroupFactory

type GroupFactory interface {
	// AddEntry adds a new string to the factory to be added later to the cache groups.
	AddEntry(entry string) bool

	// Count returns amount of processed string in the factory
	Count() int

	// Finish replaces the group in cache with factory's content
	Finish()
}

type GroupedStringCache

type GroupedStringCache interface {
	// Contains checks if one or more groups in the cache contains the search string.
	// Returns group(s) containing the string or empty slice if string was not found
	Contains(searchString string, groups []string) []string

	// Refresh creates new factory for the group to be refreshed.
	// Calling Finish on the factory will perform the group refresh.
	Refresh(group string) GroupFactory

	// ElementCount returns the amount of elements in the group
	ElementCount(group string) int
}

type InMemoryGroupedCache

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

func NewInMemoryGroupedRegexCache

func NewInMemoryGroupedRegexCache() *InMemoryGroupedCache

func NewInMemoryGroupedStringCache

func NewInMemoryGroupedStringCache() *InMemoryGroupedCache

func NewInMemoryGroupedWildcardCache

func NewInMemoryGroupedWildcardCache() *InMemoryGroupedCache

func (*InMemoryGroupedCache) Contains

func (c *InMemoryGroupedCache) Contains(searchString string, groups []string) []string

func (*InMemoryGroupedCache) ElementCount

func (c *InMemoryGroupedCache) ElementCount(group string) int

func (*InMemoryGroupedCache) Refresh

func (c *InMemoryGroupedCache) Refresh(group string) GroupFactory

Jump to

Keyboard shortcuts

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