settings

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WatchConfig added in v1.0.0

func WatchConfig(
	ctx context.Context,
	argocdService argocd.Service,
	clientset kubernetes.Interface,
	namespace string,
	callback func(Config) error, opts ...CfgOpts,
) error

Types

type CfgOpts added in v1.0.0

type CfgOpts = func(*Config, *v1.ConfigMap, *v1.Secret) error

type Config

type Config struct {
	pkg.Config

	// Context holds list of configured key value pairs available in notification templates
	Context map[string]string
	// Subscriptions holds list of default application subscriptions
	Subscriptions DefaultSubscriptions
	// DefaultTriggers holds list of triggers that is used by default if subscriber don't specify trigger
	DefaultTriggers []string
	// ArgoCDService encapsulates methods provided by Argo CD
	ArgoCDService argocd.Service
	// API allows sending notifications
	API pkg.API
}

func NewConfig added in v1.0.0

func NewConfig(configMap *v1.ConfigMap, secret *v1.Secret, argocdService argocd.Service, opts ...CfgOpts) (*Config, error)

NewConfig retrieves configured templates and triggers from the provided config map

func (Config) GetGlobalSubscriptions added in v1.0.0

func (cfg Config) GetGlobalSubscriptions(labels map[string]string) pkg.Subscriptions

Returns list of recipients for the specified trigger

type DefaultSubscription added in v1.0.0

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 added in v1.0.0

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

func (*DefaultSubscription) MatchesTrigger added in v1.0.0

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

func (*DefaultSubscription) UnmarshalJSON added in v1.0.0

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

type DefaultSubscriptions added in v0.6.1

type DefaultSubscriptions []DefaultSubscription

Jump to

Keyboard shortcuts

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