notification

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package notification provides outbound notification dispatching.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type      config.NotificationEvent `json:"type"`
	AgentName string                   `json:"agent_name"`
	TaskID    string                   `json:"task_id,omitempty"`
	Status    string                   `json:"status"`
	Result    string                   `json:"result,omitempty"`
	Error     string                   `json:"error,omitempty"`
	Timestamp time.Time                `json:"timestamp"`
	Metadata  map[string]any           `json:"metadata,omitempty"`
}

Event represents a notification event with context data.

type Notifier

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

Notifier dispatches notifications for agent events.

func New

func New(cfg *config.AppConfig, metrics *observability.Metrics) *Notifier

New creates a new Notifier from configuration.

func (*Notifier) Notify

func (n *Notifier) Notify(ctx context.Context, event Event)

Notify dispatches notifications for an event. This should be called from agent callbacks or runner hooks.

func (*Notifier) NotifyTaskCompleted

func (n *Notifier) NotifyTaskCompleted(agentName, taskID, result string)

NotifyTaskCompleted is a convenience method for task completion events.

func (*Notifier) NotifyTaskFailed

func (n *Notifier) NotifyTaskFailed(agentName, taskID, errorMsg string)

NotifyTaskFailed is a convenience method for task failure events.

func (*Notifier) NotifyTaskStarted

func (n *Notifier) NotifyTaskStarted(agentName, taskID string)

NotifyTaskStarted is a convenience method for task start events.

Jump to

Keyboard shortcuts

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