Documentation ¶
Index ¶
- Variables
- func BadDeveloperError(msg string)
- func CreateCacheBucket(bucket string)
- func EvictCache(bucket string, key string)
- func GetCache(bucket string, key string) *interface{}
- func InitLogging(level zapcore.Level)
- func PutCache(bucket string, key string, value interface{})
- func WrapJsonErrorf(path string, err error, text string, args ...interface{}) error
- func WrapRange(value, start, end int) int
- func WrappedJsonErrorf(path string, text string, args ...interface{}) error
- type CacheBucket
- type NavigableMap
- func (m *NavigableMap[K, V]) Clear()
- func (m *NavigableMap[K, V]) ContainsKey(key K) bool
- func (m *NavigableMap[K, V]) ContainsMatchingKey(matchFunc func(K) bool) bool
- func (m *NavigableMap[K, V]) Get(key K) V
- func (m *NavigableMap[K, V]) IsEmpty() bool
- func (m *NavigableMap[K, V]) Keys() []K
- func (m *NavigableMap[K, V]) Put(key K, value V)
- func (m *NavigableMap[K, V]) Remove(key K)
- func (m *NavigableMap[K, V]) Size() int
- func (m *NavigableMap[K, V]) Sort(comparer func(K, K) int)
- func (m *NavigableMap[K, V]) Values() []V
Constants ¶
This section is empty.
Variables ¶
var Logger *zap.SugaredLogger
var LoggerLevel zap.AtomicLevel
Functions ¶
func BadDeveloperError ¶
func BadDeveloperError(msg string)
BadDeveloperError panics with a message that indicates a bug in the code. It should only be used in places that should never be reached or can only be reached if there is a bug in the code.
func CreateCacheBucket ¶
func CreateCacheBucket(bucket string)
CreateCacheBucket creates a cache bucket
func InitLogging ¶
func WrapJsonErrorf ¶
WrapJsonErrorf wraps an error with a stack trace and adds additional formatted text information.
func WrappedJsonErrorf ¶
WrappedJsonErrorf creates an error with a stack trace from formatted text and appends the path.
Types ¶
type CacheBucket ¶
type CacheBucket struct {
Items map[string]*interface{}
}
CacheBucket is a bucket of cache entries
type NavigableMap ¶
type NavigableMap[K comparable, V any] struct { // contains filtered or unexported fields }
NavigableMap is a map that can be navigated in order of keys. It is not thread-safe.
func MapToNavigableMap ¶
func MapToNavigableMap(entries map[string]interface{}) NavigableMap[string, interface{}]
MapToNavigableMap creates a new NavigableMap from a golang map.
func NewNavigableMap ¶
func NewNavigableMap[K comparable, V any]() NavigableMap[K, V]
NewNavigableMap creates a new NavigableMap.
func ToNavigableMap ¶
func ToNavigableMap(entries ...interface{}) NavigableMap[string, interface{}]
ToNavigableMap creates a new NavigableMap with given keys and values.
func (*NavigableMap[K, V]) ContainsKey ¶
func (m *NavigableMap[K, V]) ContainsKey(key K) bool
ContainsKey returns true if the key exists.
func (*NavigableMap[K, V]) ContainsMatchingKey ¶
func (m *NavigableMap[K, V]) ContainsMatchingKey(matchFunc func(K) bool) bool
ContainsMatchingKey returns true if the matching key exists.
func (*NavigableMap[K, V]) Get ¶
func (m *NavigableMap[K, V]) Get(key K) V
Get returns the value associated with the key.
func (*NavigableMap[K, V]) IsEmpty ¶
func (m *NavigableMap[K, V]) IsEmpty() bool
IsEmpty returns true if the map is empty.
func (*NavigableMap[K, V]) Keys ¶
func (m *NavigableMap[K, V]) Keys() []K
Keys returns the keys in order.
func (*NavigableMap[K, V]) Put ¶
func (m *NavigableMap[K, V]) Put(key K, value V)
Put puts the value associated with the key.
func (*NavigableMap[K, V]) Remove ¶
func (m *NavigableMap[K, V]) Remove(key K)
Remove removes the value associated with the key.
func (*NavigableMap[K, V]) Size ¶
func (m *NavigableMap[K, V]) Size() int
Size returns the size of the map.
func (*NavigableMap[K, V]) Sort ¶
func (m *NavigableMap[K, V]) Sort(comparer func(K, K) int)
Sort sorts the map with the specified comparator.
func (*NavigableMap[K, V]) Values ¶
func (m *NavigableMap[K, V]) Values() []V
Values returns the values in order of keys.