localsignal

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 22 Imported by: 1 module, 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 localsignal draws attention to a refusal or an approval that needs a person.

Index

Constants

This section is empty.

Variables

View Source
var NewNotifier = func() Notifier { return platformNotifier{} }

These dependencies are replaceable for callers that embed the emitter.

View Source
var OpenTTY = openTTY

Functions

func Argv0

func Argv0(command string) string

Argv0 discards assignments and shell syntax before accepting a plain executable name.

func Emit

func Emit(kind Kind, fields Fields)

func Format

func Format(kind Kind, f Fields, folded int) (title, body string)

Types

type ConsoleOrigin

type ConsoleOrigin struct {
	WorkspaceURL string
	BaseDomain   string
}

type Emitter

type Emitter struct {
	JSON         bool
	WorkspaceURL string
	BaseDomain   string
	// contains filtered or unexported fields
}

func New

func New(w io.Writer, red func(string) string, debug func(string, ...any)) *Emitter

func (*Emitter) Emit

func (e *Emitter) Emit(kind Kind, fields Fields)

Emit waits only for the bounded notification attempt, including in a process about to exit.

type Fields

type Fields struct {
	Command    bool
	Origin     *ConsoleOrigin
	Argv0      string
	Server     string
	Account    string
	Gate       string
	Session    string
	ConsoleURL string
	// Assignee marks a held command whose confirmation is the session's assignee's
	// own, not an approver's. It changes the wording only, never the kind.
	Assignee bool
}

type Kind

type Kind string
const (
	Denied          Kind = "denied"
	ApprovalPending Kind = "approval_pending"
	Paused          Kind = "paused"
)

type Notifier

type Notifier interface {
	Notify(context.Context, string, string, string) error
}

Jump to

Keyboard shortcuts

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