fieldz

package
v17.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 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]interface{}

Types

type Field

type Field struct {
	Key   string
	Value interface{}
}

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