Documentation ¶
Overview ¶
Package datautil contains general data handling objects and helper methods.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyObject ¶
func CopyObject(src interface{}, dest interface{}) error
CopyObject copies contents of a given object reference to another given object reference.
Types ¶
type MapCache ¶
type MapCache struct {
// contains filtered or unexported fields
}
MapCache is a map based cache object storing string->interface{}. It is possible to specify a maximum size, which when reached causes the oldest entries to be removed. It is also possible to set an expiry time for values. Values which are old are purged on the next access to the object.
func NewMapCache ¶
NewMapCache creates a new MapCache object. The calling function can specify the maximum size and the maximum age in seconds for entries. A value of 0 means no size constraint and no age constraint.
type PersistentMap ¶
type PersistentMap struct { Data map[string]string // Data of the persistent map // contains filtered or unexported fields }
PersistentMap is a persistent map storing string values.
func LoadPersistentMap ¶
func LoadPersistentMap(filename string) (*PersistentMap, error)
LoadPersistentMap loads a persistent map from a file.
func NewPersistentMap ¶
func NewPersistentMap(filename string) (*PersistentMap, error)
NewPersistentMap creates a new persistent map.
func (*PersistentMap) Flush ¶
func (pm *PersistentMap) Flush() error
Flush writes contents of the persistent map to the disk.