notify

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type          EventType              `json:"type"`
	ContainerID   string                 `json:"container_id,omitempty"`
	ContainerName string                 `json:"container_name,omitempty"`
	Image         string                 `json:"image,omitempty"`
	Message       string                 `json:"message"`
	Timestamp     time.Time              `json:"timestamp"`
	Extra         map[string]interface{} `json:"extra,omitempty"`
}

Event represents a notification event

type EventType

type EventType string

EventType represents the type of notification event

const (
	EventContainerUpdated   EventType = "container_updated"
	EventContainerRestarted EventType = "container_restarted"
	EventContainerUnhealthy EventType = "container_unhealthy"
	EventContainerGaveUp    EventType = "container_gave_up"
	EventUpdateCycleStart   EventType = "update_cycle_start"
	EventUpdateCycleEnd     EventType = "update_cycle_end"
)

type Notifier

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

Notifier handles sending notifications

func New

func New(webhookURL string) *Notifier

New creates a new Notifier

func (*Notifier) NotifyContainerGaveUp

func (n *Notifier) NotifyContainerGaveUp(containerName, image string, maxAttempts int)

NotifyContainerGaveUp sends a gave up notification

func (*Notifier) NotifyContainerUnhealthy

func (n *Notifier) NotifyContainerUnhealthy(containerName, image string, attempts int)

NotifyContainerUnhealthy sends an unhealthy container notification

func (*Notifier) NotifyContainerUpdated

func (n *Notifier) NotifyContainerUpdated(containerName, image, oldDigest, newDigest string)

NotifyContainerUpdated sends a container updated notification

func (*Notifier) Send

func (n *Notifier) Send(event Event) error

Send sends a notification event

Jump to

Keyboard shortcuts

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