shared

package
v1.135.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package shared holds helpers used across webhook subcommands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseEvents

func ParseEvents(raw string) []string

ParseEvents splits a comma-separated string of event keys into a deduped, trimmed slice. Empty entries (e.g. trailing commas) are skipped. Returns nil for an empty input so callers can rely on len(out)==0.

func WebhookActiveColor added in v1.17.0

func WebhookActiveColor(ios *iostreams.IOStreams) func(string) string

WebhookActiveColor maps a webhook's Active boolean (rendered as "true" or "false" by fmt.Sprintf("%v", ...)) to a color. Active webhooks are green (live, will fire) and inactive ones red (silent until re-enabled). This helper takes the already-formatted string because that's what format.Field.ColorFunc receives.

func WebhookFields

WebhookFields constructs the formatter shared by `webhook list` and `webhook view` so JSON field names and TTY columns stay in lock step.

Types

This section is empty.

Jump to

Keyboard shortcuts

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