testsender

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Package testsender provides notification sender testing support.

Index

Constants

View Source
const ProviderType = "testsender"

ProviderType defines the type of the test notification provider.

Variables

This section is empty.

Functions

func CaptureMessages

func CaptureMessages(ctx context.Context) context.Context

CaptureMessages captures messages sent in the provider context and returns a new context. Captured messages can be retrieved using MessagesInContext.

func CaptureMessagesWithHandler added in v0.19.0

func CaptureMessagesWithHandler(ctx context.Context, handler func(msg *sender.Message) error) context.Context

CaptureMessagesWithHandler captures messages sent in the provider context and returns a new context. Captured messages can be retrieved using MessagesInContext.

func MergeOptions

func MergeOptions(ctx context.Context, src Options, dst *Options, isUpdate bool) error

MergeOptions updates the destination options with the source options.

func MessagesInContext

func MessagesInContext(ctx context.Context) []*sender.Message

MessagesInContext retrieves messages sent in the provider context.

Types

type Options

type Options struct {
	Format  string `json:"format"`  // format of the message, must be "html" or "md"
	Invalid bool   `json:"invalid"` // set to true to fail creation
}

Options defines email notification provider options.

func (*Options) ApplyDefaultsAndValidate added in v0.19.0

func (o *Options) ApplyDefaultsAndValidate(ctx context.Context) error

Jump to

Keyboard shortcuts

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