mirror of
https://github.com/0xERR0R/blocky.git
synced 2026-10-12 02:01:13 +00:00
27 lines
872 B
Go
27 lines
872 B
Go
package stringcache
|
|
|
|
type GroupedStringCache interface {
|
|
// Contains checks if one or more groups in the cache contains the search string.
|
|
// Returns a map of matching group -> the rule that matched, or nil/empty when
|
|
// the string was not found.
|
|
Contains(searchString string, groups []string) map[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 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()
|
|
}
|