fieldz

package
v18.0.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgentIDFieldName         = "agent_id"
	LastConnectedAtFieldName = "recently_connected_at"
	SecondsAgoFieldName      = "seconds_ago"
	AttributesFieldName      = "attrs"
)

Variables

This section is empty.

Functions

func ToMap

func ToMap(fields []Field) map[string]any

Types

type Field

type Field struct {
	Key   string
	Value any
}

Field represents a single key value pair for logging and error tracking purposes.

func AgentID

func AgentID(agentID int64) Field

func Attributes

func Attributes(attrs map[string]any) Field

func LastConnectedAt

func LastConnectedAt(timestamp time.Time) Field

func New

func New(key string, value any) Field

func SecondsAgo

func SecondsAgo(duration time.Duration) Field

func (*Field) IsEmpty

func (f *Field) IsEmpty() bool

Jump to

Keyboard shortcuts

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