notifier

package
v0.0.0-...-a56079f Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoNotifierConfigured = fmt.Errorf("no valid configured notifier")
)

Errors

Functions

func NewLogNotifier

func NewLogNotifier() (*logNotifier, error)

NewLogNotifier returns a new logNotifier

func NewOCMNotifier

func NewOCMNotifier(client client.Client, ocmBaseUrl *url.URL, upgradeConfigManager upgradeconfigmanager.UpgradeConfigManager) (*ocmNotifier, error)

NewOCMNotifier returns a ocmNotifier

Types

type ConfigManagerSource

type ConfigManagerSource string

ConfigManagerSource is a type that denotes the source of configuration management

const (
	// OCM denotes OCM as the config manager source
	OCM ConfigManagerSource = "OCM"
	// LOCAL denotes a local config manager source
	LOCAL ConfigManagerSource = "LOCAL"
)

type MuoState

type MuoState string

MuoState is a type

const (
	MuoStatePending   MuoState = "StatePending"
	MuoStateStarted   MuoState = "StateStarted"
	MuoStateCompleted MuoState = "StateCompleted"
	MuoStateDelayed   MuoState = "StateDelayed"
	MuoStateFailed    MuoState = "StateFailed"
	MuoStateCancelled MuoState = "StateCancelled"
	MuoStateScheduled MuoState = "StateScheduled"
	MuoStateSkipped   MuoState = "StateSkipped"
)

Represents valid notify states that can be reported

type Notifier

type Notifier interface {
	NotifyState(value MuoState, description string) error
}

Notifier is an interface that enables implementation of a Notifier

type NotifierBuilder

NotifierBuilder is an interface that enables implementation of a NotifierBuilder

func NewBuilder

func NewBuilder() NotifierBuilder

NewBuilder creates a new Notifier instance builder

type NotifierConfig

type NotifierConfig struct {
	ConfigManager NotifierConfigManager `yaml:"configManager"`
}

NotifierConfig is a type that provides a NotifierConfig

func (*NotifierConfig) IsValid

func (cfg *NotifierConfig) IsValid() error

IsValid returns no error if the notifier config is valid

type NotifierConfigManager

type NotifierConfigManager struct {
	Source string `yaml:"source"`
}

NotifierConfigManager is a type that provides a notifier source

type OcmNotifierConfig

type OcmNotifierConfig struct {
	ConfigManager OcmNotifierConfigManager `yaml:"configManager"`
}

OcmNotifierConfig holds a ConfigManager field for its OCM configuration

func (*OcmNotifierConfig) GetOCMBaseURL

func (cfg *OcmNotifierConfig) GetOCMBaseURL() *url.URL

GetOCMBaseURL returns the OcmBaseUrl from the OcmNotifierConfig object

func (*OcmNotifierConfig) IsValid

func (cfg *OcmNotifierConfig) IsValid() error

IsValid returns a nil error when the OcmNotifierConfig is valid

type OcmNotifierConfigManager

type OcmNotifierConfigManager struct {
	OcmBaseUrl string `yaml:"ocmBaseUrl"`
}

OcmNotifierConfigManager holds the OcmBaseUrl field

type OcmState

type OcmState string
const (
	OcmStatePending   OcmState = "pending"
	OcmStateStarted   OcmState = "started"
	OcmStateDelayed   OcmState = "delayed"
	OcmStateFailed    OcmState = "failed"
	OcmStateCompleted OcmState = "completed"
	OcmStateCancelled OcmState = "cancelled"
	OcmStateScheduled OcmState = "scheduled"
)

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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