kv

package
v0.0.0-...-b0c7f7e Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeLayout = time.RFC3339Nano
)

Variables

This section is empty.

Functions

func Logfmt

func Logfmt(buf *buffer.Buffer, kvs []KeyValue)

func LogfmtAppendString

func LogfmtAppendString(buf *buffer.Buffer, s string)

func LogfmtMessage

func LogfmtMessage(msg string, kvs []KeyValue) string

Types

type KeyValue

type KeyValue struct {
	Key   string
	Value Value
}

func Any

func Any(key string, value any) KeyValue

func Bool

func Bool(key string, value bool) KeyValue

func Duration

func Duration(key string, value time.Duration) KeyValue

func Error

func Error(err error) KeyValue

func Float

func Float(key string, value float64) KeyValue

func Int

func Int(key string, value int64) KeyValue

func String

func String(key string, value string) KeyValue

func Time

func Time(key string, value time.Time) KeyValue

func Uint

func Uint(key string, value uint64) KeyValue

type Kind

type Kind int
const (
	KindAny Kind = iota // Do not change
	KindBool
	KindDuration
	KindFloat
	KindInt
	KindString
	KindTime
	KindUint
)

type Value

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

func AnyValue

func AnyValue(value any) Value

func BoolValue

func BoolValue(value bool) Value

func DurationValue

func DurationValue(value time.Duration) Value

func FloatValue

func FloatValue(value float64) Value

func IntValue

func IntValue(value int64) Value

func StringValue

func StringValue(value string) Value

func TimeValue

func TimeValue(value time.Time) Value

func UintValue

func UintValue(value uint64) Value

func (Value) Bool

func (v Value) Bool() bool

func (Value) Duration

func (v Value) Duration() time.Duration

func (Value) Float

func (v Value) Float() float64

func (Value) Int

func (v Value) Int() int64

func (Value) Kind

func (v Value) Kind() Kind

func (Value) String

func (v Value) String() string

func (Value) Time

func (v Value) Time() time.Time

func (Value) Uint

func (v Value) Uint() uint64

Jump to

Keyboard shortcuts

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