stringcache

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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