Documentation ¶
Overview ¶
Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunCommand ¶
func SetToSlice ¶ added in v1.6.0
func SetToSlice[V comparable](m map[V]struct{}) []V
SetToSlice returns a slice containing the keys of the provided Set/map
func SliceToSet ¶ added in v1.6.0
func SliceToSet[V comparable](s []V) map[V]struct{}
SliceToSet returns a Set/map whose keys are formed by the values in the slice argument. It will deduplicate any repeated value in the slice
Types ¶
type Command ¶
func NewCommand ¶
type Map2 ¶ added in v1.2.0
type Map2[K1, K2 comparable, V any] map[K1]map[K2]V
Map2 implements a 2-level map where each 1st-level key maps to a 2nd level map.
func (Map2[K1, K2, V]) DeleteAll ¶ added in v1.2.0
func (m Map2[K1, K2, V]) DeleteAll(key1 K1)
DeleteAll the 2nd-level entries associated with the 1st-level key.
type MultiCounter ¶ added in v1.2.0
type MultiCounter[K comparable] map[K]*int
MultiCounter maps a counter to a given key
func (MultiCounter[K]) Dec ¶ added in v1.2.0
func (m MultiCounter[K]) Dec(key K) int
Dec decrements the counter associated to the given key and returns the new count.
func (MultiCounter[K]) Inc ¶ added in v1.2.0
func (m MultiCounter[K]) Inc(key K) int
Inc increments the counter associated to the given key and returns the new count.