helpers

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

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 RunCommand(command string, stdin string, arguments ...string) (string, error)

Types

type Command

type Command struct {
	*exec.Cmd
}

func NewCommand

func NewCommand(command string, arguments ...string) *Command

func (*Command) Run

func (c *Command) Run() (string, error)

func (*Command) WithStdin

func (c *Command) WithStdin(stdin string) *Command

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]) Delete added in v1.2.0

func (m Map2[K1, K2, V]) Delete(key1 K1, key2 K2)

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.

func (Map2[K1, K2, V]) Get added in v1.2.0

func (m Map2[K1, K2, V]) Get(key1 K1, key2 K2) (V, bool)

func (Map2[K1, K2, V]) Put added in v1.2.0

func (m Map2[K1, K2, V]) Put(key1 K1, key2 K2, val V)

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.

Directories

Path Synopsis
Package container provides helper tools to inspect container information
Package container provides helper tools to inspect container information

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL