Documentation
¶
Overview ¶
Package hashmap implemets a modified version of Go's map type using type parameters. See https://github.com/golang/go/blob/master/src/runtime/map.go
Index ¶
- Variables
- type AggFlowMap
- func (a AggFlowMap) Clear()
- func (a AggFlowMap) ClearFast()
- func (a *AggFlowMap) Flatten() (primaryList List, secondaryList List)
- func (a AggFlowMap) IsNil() bool
- func (a AggFlowMap) Iter(opts ...MetaIterOption) *MetaIter
- func (a AggFlowMap) Len() int
- func (a AggFlowMap) Merge(b AggFlowMap)
- func (a AggFlowMap) SetOrUpdate(key Key, isIPv4 bool, eA, eB, eC, eD uint64)
- type AggFlowMapWithMetadata
- type Item
- type Iter
- type Key
- type KeyVal
- type KeyVals
- type List
- type Map
- type MetaIter
- type MetaIterOption
- type NamedAggFlowMapWithMetadata
- type Val
- type ValFilter
Constants ¶
This section is empty.
Variables ¶
var NilAggFlowMapWithMetadata = AggFlowMapWithMetadata{}
NilAggFlowMapWithMetadata denotes an empty / "nil" AggFlowMapWithMetadata
Functions ¶
This section is empty.
Types ¶
type AggFlowMap ¶
AggFlowMap stores all flows where the source port from the FlowLog has been aggregated Just a convenient alias for the map type itself
func NewAggFlowMap ¶
func NewAggFlowMap(n ...int) *AggFlowMap
NewAggFlowMap instantiates a new NewAggFlowMap with an underlying hashmap for both IPv4 and IPv6 entries
func (AggFlowMap) Clear ¶
func (a AggFlowMap) Clear()
Clear frees as many resources as possible by making them eligible for GC
func (AggFlowMap) ClearFast ¶
func (a AggFlowMap) ClearFast()
ClearFast nils all main resources, making them eligible for GC (but probably not as effectively as Clear())
func (*AggFlowMap) Flatten ¶
func (a *AggFlowMap) Flatten() (primaryList List, secondaryList List)
Flatten converts a flow map to a flat table / list
func (AggFlowMap) IsNil ¶
func (a AggFlowMap) IsNil() bool
IsNil returns if an AggFlowMap is nil (used e.g. in cases of error)
func (AggFlowMap) Iter ¶
func (a AggFlowMap) Iter(opts ...MetaIterOption) *MetaIter
Iter provides a map Iter to allow traversal of both underlying maps (IPv4 and IPv6)
func (AggFlowMap) Merge ¶
func (a AggFlowMap) Merge(b AggFlowMap)
Merge allows to incorporate the content of a map b into an existing map a
func (AggFlowMap) SetOrUpdate ¶
func (a AggFlowMap) SetOrUpdate(key Key, isIPv4 bool, eA, eB, eC, eD uint64)
SetOrUpdate either creates a new entry based on the provided values or updates any existing valent (if exists). This way may be very specific, but it avoids intermediate allocation of a value type valent in case of an update
type AggFlowMapWithMetadata ¶
type AggFlowMapWithMetadata struct { *AggFlowMap Interface string `json:"iface"` Stats *workload.Stats }
AggFlowMapWithMetadata provides a wrapper around the map with ancillary data
func NewAggFlowMapWithMetadata ¶
func NewAggFlowMapWithMetadata(n ...int) AggFlowMapWithMetadata
NewAggFlowMapWithMetadata instantiates a new AggFlowMapWithMetadata with an underlying hashmap for both IPv4 and IPv6 entries
func (AggFlowMapWithMetadata) IsNil ¶
func (a AggFlowMapWithMetadata) IsNil() bool
IsNil returns if an AggFlowMapWithMetadata is nil (used e.g. in cases of error)
func (AggFlowMapWithMetadata) Merge ¶
func (a AggFlowMapWithMetadata) Merge(b AggFlowMapWithMetadata)
Merge allows to incorporate the content of a map b into an existing map a
type Iter ¶
type Iter struct {
// contains filtered or unexported fields
}
Iter provides a map Iter to allow traversal
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map denotes the main type of the hashmap implementation
func (*Map) Clear ¶
func (m *Map) Clear()
Clear frees as many resources as possible by making them eligible for GC
func (*Map) ClearFast ¶
func (m *Map) ClearFast()
ClearFast nils all main resources, making them eligible for GC (but probably not as effectively as Clear())
func (*Map) Merge ¶
Merge allows to incorporate the content of a map m2 into an existing map m (providing additional in-place counter updates). It re-uses / duplicates code from the iterator part to minimize function call overhead and allocations
func (*Map) Set ¶
Set either creates a new entry based on the provided values or updates any existing valent (if exists).
func (*Map) SetOrUpdate ¶
SetOrUpdate either creates a new entry based on the provided values or updates any existing valent (if exists). This way may be very specific, but it avoids intermediate allocation of a value type valent in case of an update
type MetaIter ¶
type MetaIter struct { *Iter // primary iterator // contains filtered or unexported fields }
MetaIter denotes a wrapper around an primary & secondary hashmap construct, allowing easy access to a global iterator running through both sub-maps
type MetaIterOption ¶
type MetaIterOption func(it *MetaIter)
MetaIterOption denotes a functional option to a MetaIter
func WithFilter ¶
func WithFilter(filter ValFilter) MetaIterOption
WithFilter sets a filter for the MetaIter
type NamedAggFlowMapWithMetadata ¶
type NamedAggFlowMapWithMetadata map[string]*AggFlowMapWithMetadata
NamedAggFlowMapWithMetadata provides wrapper around a map of AggFlowMapWithMetadata instances (e.g. interface -> AggFlowMapWithMetadata associations)
func NewNamedAggFlowMapWithMetadata ¶
func NewNamedAggFlowMapWithMetadata(names []string) (m NamedAggFlowMapWithMetadata)
NewNamedAggFlowMapWithMetadata instantiates a new NewNamedAggFlowMapWithMetadata based on a list of names, initializing an instance of AggFlowMapWithMetadata per element
func (NamedAggFlowMapWithMetadata) Clear ¶
func (n NamedAggFlowMapWithMetadata) Clear()
Clear frees as many resources as possible by making them eligible for GC
func (NamedAggFlowMapWithMetadata) ClearFast ¶
func (n NamedAggFlowMapWithMetadata) ClearFast()
ClearFast nils all main resources, making them eligible for GC (but probably not as effectively as Clear())
func (NamedAggFlowMapWithMetadata) Len ¶
func (n NamedAggFlowMapWithMetadata) Len() (l int)
Len returns the number of entries in all maps