mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
console: dynamically fetch available dimensions
This commit is contained in:
@@ -33,6 +33,24 @@ func (bi *Bimap[K, V]) LoadKey(v V) (K, bool) {
|
||||
return k, ok
|
||||
}
|
||||
|
||||
// Keys returns a slice of the keys in the bimap.
|
||||
func (bi *Bimap[K, V]) Keys() []K {
|
||||
var keys []K
|
||||
for k := range bi.forward {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
return keys
|
||||
}
|
||||
|
||||
// Values returns a slice of the values in the bimap.
|
||||
func (bi *Bimap[K, V]) Values() []V {
|
||||
var values []V
|
||||
for v := range bi.inverse {
|
||||
values = append(values, v)
|
||||
}
|
||||
return values
|
||||
}
|
||||
|
||||
// String returns a string representation of the bimap.
|
||||
func (bi *Bimap[K, V]) String() string {
|
||||
return fmt.Sprintf("Bi%v", bi.forward)
|
||||
|
||||
Reference in New Issue
Block a user