Documentation
¶
Overview ¶
DigiStratum GoLib - HashMap
Index ¶
- type HashMap
- func (r *HashMap) Copy() *HashMap
- func (r *HashMap) Drop(key string) *HashMap
- func (r *HashMap) DropAll()
- func (r *HashMap) DropSet(keys *[]string) *HashMap
- func (r *HashMap) Get(key string) *string
- func (r *HashMap) GetBool(key string) bool
- func (r *HashMap) GetInt64(key string) *int64
- func (r *HashMap) GetIterator() func() interface{}
- func (r *HashMap) GetKeys() []string
- func (r *HashMap) GetMissing(keys *[]string) *[]string
- func (r *HashMap) GetSubset(keys *[]string) *HashMap
- func (r *HashMap) Has(key string) bool
- func (r *HashMap) HasAll(keys ...string) bool
- func (r *HashMap) IsEmpty() bool
- func (r *HashMap) LoadFromJsonFile(jsonFile string) error
- func (r *HashMap) LoadFromJsonString(jsonStr *string) error
- func (r *HashMap) MarshalJSON() ([]byte, error)
- func (r *HashMap) Merge(mergeHash HashMapIfc)
- func (r *HashMap) Set(key, value string)
- func (r *HashMap) Size() int
- func (r *HashMap) ToJson() (*string, error)
- func (r *HashMap) ToLog(logger log.LoggerIfc, level log.LogLevel, label string)
- func (r *HashMap) UnmarshalJSON(value []byte) error
- type HashMapIfc
- type KeyValuePair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashMap ¶
type HashMap struct {
// contains filtered or unexported fields
}
func NewHashMap ¶
func NewHashMap() *HashMap
func NewHashMapFromJsonFile ¶
func (*HashMap) Copy ¶
Get a full (deep) copy of this HashMap This is so that we can give away a copy to someone else without allowing them to tamper with us ref: https://developer20.com/be-aware-of-coping-in-go/
func (*HashMap) GetIterator ¶
func (r *HashMap) GetIterator() func() interface{}
Iterate over all of our items, returning each as a *KeyValuePair in the form of an interface{}
func (*HashMap) GetMissing ¶
Get the list of missing keys according to HasAll()
func (*HashMap) LoadFromJsonFile ¶
Load our hash map with JSON data from a file (or return an error)
func (*HashMap) LoadFromJsonString ¶
Load our hash map with JSON data from a string (or return an error)
func (*HashMap) MarshalJSON ¶
func (*HashMap) Merge ¶
func (r *HashMap) Merge(mergeHash HashMapIfc)
Merge some additional data on top of our own
func (*HashMap) ToLog ¶
Dump JSON-like representation of our entries in readable form to supplied logger
func (*HashMap) UnmarshalJSON ¶
type HashMapIfc ¶
type HashMapIfc interface {
Copy() *HashMap
LoadFromJsonString(jsonStr *string) error
LoadFromJsonFile(jsonFile string) error
IsEmpty() bool
Size() int
Merge(mergeHash HashMapIfc)
Set(key, value string)
Get(key string) *string
GetInt64(key string) *int64
GetBool(key string) bool
GetKeys() []string
Has(key string) bool
HasAll(keys ...string) bool
GetMissing(keys *[]string) *[]string
GetSubset(keys *[]string) *HashMap
Drop(key string) *HashMap
DropSet(keys *[]string) *HashMap
DropAll()
GetIterator() func() interface{}
ToJson() (*string, error)
ToLog(logger log.LoggerIfc, level log.LogLevel, label string)
}
HashMap public interface