pretty

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: Apache-2.0 Imports: 11 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Concise

func Concise(o interface{}) string

func Map added in v0.33.2

func Map[K constraints.Ordered, V any](values map[K]V, maxItems int) string

Map truncates a map after a certain number of max items to ensure that the description in a log doesn't get too long

func Slice

func Slice[T any](s []T, maxItems int) string

Slice truncates a slice after a certain number of max items to ensure that the Slice isn't too long

func Taint added in v1.0.2

func Taint(t v1.Taint) string

func ToSnakeCase added in v1.1.1

func ToSnakeCase(str string) string

Types

type ChangeMonitor

type ChangeMonitor struct {
	// contains filtered or unexported fields
}

ChangeMonitor is used to reduce logging when discovering information that may change. The values recorded expire after 24 hours by default to prevent a value from being logged at startup only which could impede debugging if full sets of logs aren't available.

func NewChangeMonitor

func NewChangeMonitor() *ChangeMonitor

func (*ChangeMonitor) HasChanged

func (c *ChangeMonitor) HasChanged(key string, value any) bool

HasChanged takes a key and value and returns true if the hash of the value has changed since the last tine the change monitor was called.

Jump to

Keyboard shortcuts

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