v2k8s.io/klog/v2/internal/serialize Index | Files

package serialize

import "k8s.io/klog/v2/internal/serialize"

Index

Functions

func ErrorToString

func ErrorToString(err error) (ret string)

ErrorToString converts an error to a string, handling panics if they occur.

func KVListFormat

func KVListFormat(b *bytes.Buffer, keysAndValues ...interface{})

KVListFormat serializes all key/value pairs into the provided buffer. A space gets inserted before the first pair and between each pair.

func StringerToString

func StringerToString(s fmt.Stringer) (ret string)

StringerToString converts a Stringer to a string, handling panics if they occur.

func TrimDuplicates

func TrimDuplicates(kvLists ...[]interface{}) [][]interface{}

TrimDuplicates deduplicates elements provided in multiple key/value tuple slices, whilst maintaining the distinction between where the items are contained.

func WithValues

func WithValues(oldKV, newKV []interface{}) []interface{}

WithValues implements LogSink.WithValues. The old key/value pairs are assumed to be well-formed, the new ones are checked and padded if necessary. It returns a new slice.

Source Files

keyvalues.go

Version
v2.50.2
Published
Mar 16, 2022
Platform
linux/amd64
Imports
3 packages
Last checked
1 day ago

Tools for package owners.