Documentation
¶
Index ¶
- type CacheBucket
- type CacheClient
- type CacheCollection
- type CacheDoc
- type CacheExpire
- type CacheTime
- type Coder
- type Decoder
- type Encoder
- type LabelSet
- func (ls LabelSet) CheckAnd(labels []string) bool
- func (ls LabelSet) CheckOr(labels []string) bool
- func (ls LabelSet) Copy() LabelSet
- func (ls LabelSet) Format() string
- func (ls LabelSet) From(labels []string) LabelSet
- func (ls LabelSet) FromStr(labels string) LabelSet
- func (ls LabelSet) List() []string
- type Logger
- type MembersMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheBucket ¶
type CacheBucket interface {
Name() string
Docs(keys []string) []CacheDoc
Values(keys []string) []any
Update(key string, data any) CacheDoc
// UpdateWithTs return doc and flag to indicate if data is updated or not
UpdateWithTs(key string, data any, ts time.Time) (CacheDoc, bool)
//Filter return all keys that match the given label filters
Filter(labelFilters ...[]string) []string
// Scan return all keys that match the given pattern
Scan(match string) []string
Remove(keys []string) []CacheDoc
Clear()
Delete()
GetLastErrors() []error
}
type CacheClient ¶
type CacheClient interface {
WithBucket(CacheBucket) CacheBucket
Bucket(name string) CacheBucket
Buckets() []CacheBucket
RemoveBucket(bktName string)
Collection(name string) CacheCollection
Collections() []CacheCollection
RemoveCollection(name string)
}
type CacheCollection ¶
type CacheExpire ¶
type Logger ¶
type Logger interface {
// Debug logs a debug message with optional key-value pairs
Debug(msg string, keysAndValues ...any)
// Info logs an informational message with optional key-value pairs
Info(msg string, keysAndValues ...any)
// Error logs an error message with optional key-value pairs
Error(msg string, keysAndValues ...any)
// Fatal logs an error message and then panics
// This is used for critical errors that should stop execution
Fatal(msg string, keysAndValues ...any)
}
Logger is an interface for logging in the cache system. Users can provide their own implementation to integrate with their logging framework.
type MembersMap ¶
type MembersMap map[string]struct{}
func (MembersMap) Exists ¶
func (smm MembersMap) Exists(mem string) bool
func (MembersMap) List ¶
func (smm MembersMap) List() []string
Click to show internal directories.
Click to hide internal directories.