notification

package
v0.0.0-...-e07a38c Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextReplyTo = "ReplyTo"
)

Variables

This section is empty.

Functions

func NewMailgunDeliveryError

func NewMailgunDeliveryError(id, response, errorMessage string) error

Types

type BaseNotificationDeliveryService

type BaseNotificationDeliveryService struct {
	TemplateLoader TemplateLoader
}

func (*BaseNotificationDeliveryService) GenerateContent

func (s *BaseNotificationDeliveryService) GenerateContent(context map[string]string,
	templateDefinition string) (string, error)

type DefaultTemplateLoader

type DefaultTemplateLoader struct{}

func (*DefaultTemplateLoader) GetNotificationTemplate

func (l *DefaultTemplateLoader) GetNotificationTemplate(name string, templateSetName string) (*notificationtemplates.NotificationTemplate, error)

type DeliveryService

type DeliveryService interface {
	Send(notification *toolchainv1alpha1.Notification, templateSetName string) error
}

func NewMailgunNotificationDeliveryService

func NewMailgunNotificationDeliveryService(config DeliveryServiceFactoryConfig, templateLoader TemplateLoader,
	opts ...MailgunOption) DeliveryService

NewMailgunNotificationDeliveryService creates a delivery service that uses the Mailgun API to deliver email notifications

type DeliveryServiceFactory

type DeliveryServiceFactory struct {
	Client runtimeclient.Client
	Config DeliveryServiceFactoryConfig
}

func NewNotificationDeliveryServiceFactory

func NewNotificationDeliveryServiceFactory(client runtimeclient.Client, config DeliveryServiceFactoryConfig) *DeliveryServiceFactory

func (*DeliveryServiceFactory) CreateNotificationDeliveryService

func (f *DeliveryServiceFactory) CreateNotificationDeliveryService() (DeliveryService, error)

type DeliveryServiceFactoryConfig

type DeliveryServiceFactoryConfig interface {
	MailgunConfig
	// contains filtered or unexported methods
}

type MailgunConfig

type MailgunConfig interface {
	GetMailgunDomain() string
	GetMailgunAPIKey() string
	GetMailgunSenderEmail() string
	GetMailgunReplyToEmail() string
}

type MailgunDeliveryError

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

func (MailgunDeliveryError) Error

func (e MailgunDeliveryError) Error() string

type MailgunNotificationDeliveryService

type MailgunNotificationDeliveryService struct {
	Mailgun      mailgun.Mailgun
	SenderEmail  string
	ReplyToEmail string
	// contains filtered or unexported fields
}

func (*MailgunNotificationDeliveryService) Send

func (s *MailgunNotificationDeliveryService) Send(notification *toolchainv1alpha1.Notification, templateSetName string) error

type MailgunOption

type MailgunOption interface {
	// ApplyToMailgun applies this configuration to the given mailgun instance.
	ApplyToMailgun(mailgun.Mailgun)
}

type Reconciler

type Reconciler struct {
	Client runtimeclient.Client
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

Reconciler reconciles a Notification object

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)

func (*Reconciler) SetupWithManager

func (r *Reconciler) SetupWithManager(mgr manager.Manager, config toolchainconfig.ToolchainConfig) error

SetupWithManager sets up the controller with the Manager.

type TemplateLoader

type TemplateLoader interface {
	GetNotificationTemplate(name string, templateSetName string) (*notificationtemplates.NotificationTemplate, error)
}

Jump to

Keyboard shortcuts

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