subscriptions

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NotifiedAnnotationKey

func NotifiedAnnotationKey() string

func SetAnnotationPrefix

func SetAnnotationPrefix(prefix string)

SetAnnotationPrefix sets the annotationPrefix to the provided string. defaults to "notifications.argoproj.io"

func SubscribeAnnotationKey

func SubscribeAnnotationKey(trigger string, service string) string

Types

type Annotations

type Annotations map[string]string

func NewAnnotations

func NewAnnotations(annotations map[string]string) Annotations

func (Annotations) GetDestinations

func (a Annotations) GetDestinations(defaultTriggers []string, serviceDefaultTriggers map[string][]string) services.Destinations

func (Annotations) Has

func (a Annotations) Has(service string, recipient string) bool

func (Annotations) Subscribe

func (a Annotations) Subscribe(trigger string, service string, recipients ...string)

func (Annotations) Unsubscribe

func (a Annotations) Unsubscribe(trigger string, service string, recipient string)

type DefaultSubscription

type DefaultSubscription struct {
	// Recipients comma separated list of recipients
	Recipients []string
	// Optional trigger name
	Triggers []string
	// Options label selector that limits applied applications
	Selector labels.Selector
}

DefaultSubscription holds recipients that receives notification by default.

func (*DefaultSubscription) MarshalJSON

func (s *DefaultSubscription) MarshalJSON() ([]byte, error)

func (*DefaultSubscription) MatchesTrigger

func (s *DefaultSubscription) MatchesTrigger(trigger string) bool

func (*DefaultSubscription) UnmarshalJSON

func (s *DefaultSubscription) UnmarshalJSON(data []byte) error

type DefaultSubscriptions

type DefaultSubscriptions []DefaultSubscription

type Destination

type Destination struct {
	Service    string   `json:"service"`
	Recipients []string `json:"recipients"`
}

Destination holds notification destination details

type Subscription

type Subscription struct {
	Trigger      []string
	Destinations []Destination
}

Jump to

Keyboard shortcuts

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