templates

package
v0.0.0-...-a3dbc15 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileNotExist     = errors.New("the file does not exist")
	ErrFileRead         = errors.New("could not read the file")
	ErrInvalidStatus    = errors.New("the status provided is invalid")
	ErrTemplateEmpty    = errors.New("the environment variable provided is empty")
	ErrTemplateNotExist = errors.New("the template does not exist")
)

Functions

func DetermineTemplate

func DetermineTemplate(templateVar, templatePath, templateInline, templateName, jobStatus string) (string, error)

DetermineTemplate returns the template to use for the notification. The order of precedence is templateVar, templatePath, templateInline, templateName. If none of these are provided the default template for the job status is used.

func ForName

func ForName(name string) string

ForName returns the default template body for the provided name if it exists, or the empty string if there is no default.

func ForStatus

func ForStatus(status string) string

ForStatus returns the default template body for the provided status if it exists, or the empty string if there is no default.

Types

This section is empty.

Jump to

Keyboard shortcuts

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