utils

package
v1.4.15-slog2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 3 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultIfEmpty added in v1.4.0

func DefaultIfEmpty(m map[string]string, def map[string]string) map[string]string

func EnrichLoggerWithLabels

func EnrichLoggerWithLabels(logger *unilogger.Logger, labelsMaps ...map[string]string) *unilogger.Logger

func IsSubset added in v1.4.10

func IsSubset(a, b []string) bool

IsSubset checks if a set contains b subset

func LabelNames

func LabelNames(labels map[string]string) []string

LabelNames returns sorted label keys

func LabelValues

func LabelValues(labels map[string]string, labelNames []string) []string

func MergeLabels

func MergeLabels(labelsMaps ...map[string]string) map[string]string

MergeLabels merges several maps into one. Last map keys overrides keys from first maps.

Can be used to copy a map if just one argument is used.

Types

This section is empty.

Jump to

Keyboard shortcuts

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