command

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package command implements a Pilot notification plugin that executes a user-provided script from /config/scripts/ on each event. The event payload is passed as JSON on stdin and key fields are set as environment variables.

Index

Constants

This section is empty.

Variables

View Source
var ScriptsDir = "/config/scripts" //nolint:gochecknoglobals // injectable for tests

ScriptsDir is the directory from which scripts are resolved. Package-level var so tests can override it.

Functions

This section is empty.

Types

type Config

type Config struct {
	ScriptName string `json:"script_name"`
	Timeout    int    `json:"timeout,omitempty"` // seconds; default 30
}

Config holds the user-supplied settings for a command notifier.

type Notifier

type Notifier struct {
	// contains filtered or unexported fields
}

Notifier is a command notifier plugin instance.

func New

func New(cfg Config) *Notifier

New creates a new Notifier from the given config.

func (*Notifier) Name

func (*Notifier) Name() string

func (*Notifier) Notify

func (n *Notifier) Notify(ctx context.Context, event plugin.NotificationEvent) error

Notify executes the configured script with event data.

func (*Notifier) Test

func (n *Notifier) Test(_ context.Context) error

Test verifies the script file exists and is executable.

Jump to

Keyboard shortcuts

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