notifications

package
v0.0.0-...-9008a76 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Composer

type Composer interface {
	Render(notification string, data map[string]interface{}, carrier string) (*ContentSet, error)
}

Composer defines the interface to create a ContentSet

type ContentSet

type ContentSet struct {
	HTMLs map[string]string
	Texts map[string]string
}

ContentSet contains the set of rendered pieces to be used for a given Carrier (to create a Dispatch for each target user)

type FileSystemComposer

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

FileSystemComposer is notification template renderer

func NewFileSystemComposer

func NewFileSystemComposer(templatesDir string) *FileSystemComposer

NewFileSystemComposer creates a new FileSystemComposer

func (*FileSystemComposer) Render

func (r *FileSystemComposer) Render(notification string, data map[string]interface{}, carrier string) (*ContentSet, error)

Render renders a notifications using the provided data

type NopComposer

type NopComposer struct {
}

func NewNopComposer

func NewNopComposer() *NopComposer

func (*NopComposer) Render

func (n *NopComposer) Render(notification string, data map[string]interface{},
	carrier string) (*ContentSet, error)

Jump to

Keyboard shortcuts

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