fieldz

package
v17.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

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

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 LastConnectedAt

func LastConnectedAt(timestamp time.Time) Field

func NewField

func NewField(key string, value any) Field

func SecondsAgo

func SecondsAgo(duration time.Duration) Field

Jump to

Keyboard shortcuts

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