Documentation ¶
Overview ¶
Package data implements generic data structures and deletion of old data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsIDValid ¶
IsIDValid determines whether or not a URL can be a valid actor, object or activity ID.
func ParsePrivateKey ¶
ParsePrivateKey parses private keys.
Types ¶
type GarbageCollector ¶
type OrderedMap ¶
type OrderedMap[TK comparable, TV any] map[TK]valueAndIndex[TV]
OrderedMap is a map that maintains insertion order. Listing of keys (using OrderedMap.Keys) iterates over keys and allocates memory.
func (OrderedMap[TK, TV]) Contains ¶
func (m OrderedMap[TK, TV]) Contains(key TK) bool
Contains determines if the map contains a key.
func (OrderedMap[TK, TV]) Keys ¶
func (m OrderedMap[TK, TV]) Keys() []TK
Keys returns a list of keys in the map. To do so, it iterates over keys and allocates memory.
func (OrderedMap[TK, TV]) Range ¶
func (m OrderedMap[TK, TV]) Range(f func(key TK, value TV) bool)
Range iterates over the map and calls a callback for each key/value pair. Iteration stops if the callback returns false. Range calls OrderedMap.Keys, therefore it allocates memory.
func (OrderedMap[TK, TV]) Store ¶
func (m OrderedMap[TK, TV]) Store(key TK, value TV)
Store adds a key/value pair to the map if the map doesn't contain it already.