event

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package event formats and renders event log timestamps and entries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractHookName

func ExtractHookName(e notify.Payload) string

ExtractHookName gets the hook name from an event payload's detail field. Falls back to extracting from the message prefix (e.g., "qa-reminder: ...").

Parameters:

  • e: event payload to inspect

Returns:

  • string: hook name, or EventsHookFallback if undetermined

func FormatHuman

func FormatHuman(evts []notify.Payload) []string

FormatHuman formats events in aligned columns for human reading.

Parameters:

  • evts: event payloads to format

Returns:

  • []string: formatted event lines

func FormatJSON

func FormatJSON(evts []notify.Payload) []string

FormatJSON formats events as raw JSONL lines.

Parameters:

  • evts: event payloads to serialize

Returns:

  • []string: JSON lines (marshal errors are silently skipped)

func FormatTimestamp

func FormatTimestamp(ts string) string

FormatTimestamp converts an RFC3339 timestamp to local time display using the DateTimePreciseFormat layout.

Parameters:

  • ts: RFC3339-formatted timestamp string

Returns:

  • string: local time formatted as "2006-01-02 15:04:05", or the original string on parse failure

func TruncateMessage

func TruncateMessage(msg string, maxLen int) string

TruncateMessage limits message length for display, appending a truncation suffix when the message exceeds maxLen characters.

Parameters:

  • msg: message to potentially truncate
  • maxLen: maximum allowed length including suffix

Returns:

  • string: original or truncated message

Types

This section is empty.

Jump to

Keyboard shortcuts

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