notify

package
v1.78.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 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 notify sends the update notifications of packages to the webhook of the notification settings (update.notification of the deckhouse module); the package Reconciler decides when.

Index

Constants

View Source
const (
	SubjectApplication = "Application" // SubjectApplication announces an update of an Application.
	SubjectModule      = "Module"      // SubjectModule announces an update of a Module.
)

Subjects of a notification: what kind of package is updated.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Username string
	Password string
	Token    string
}

Auth authenticates the request: basic auth when Username is set, else a bearer Token when set.

type Config

type Config struct {
	WebhookURL    string
	SkipTLSVerify bool
	Auth          Auth
}

Config is the webhook of the notification settings.

type Notifier

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

Notifier sends announcements to one webhook; it satisfies model.Notifier. Safe for concurrent use.

func New

func New(config Config) *Notifier

New returns a Notifier of the webhook in config.

func (*Notifier) Notify

func (n *Notifier) Notify(ctx context.Context, a model.Announcement) error

Notify posts one announcement, once: the package Reconciler retries a failure with backoff.

type Payload

type Payload struct {
	Subject   string `json:"subject"`
	Name      string `json:"name"`                // Name is the application or module name.
	Namespace string `json:"namespace,omitempty"` // Namespace is the application's; empty for a module.
	Version   string `json:"version"`
	ApplyTime string `json:"applyTime,omitempty"`
	Message   string `json:"message"`
}

Payload is the body of a notification.

Jump to

Keyboard shortcuts

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