formatter

package
v0.0.0-...-634d34d Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

type Formatter interface {
	// Return body and subject.
	GetSubjectAndBody(ctx context.Context, culprit *pb.Culprit, subscription *sub_pb.Subscription) (string, string, error)
}

Formatter controls how the notification looks like

type MarkdownFormatter

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

MarkdownFormatter implement Formatter.

func NewMarkdownFormatter

func NewMarkdownFormatter(commitURLTemplate string, notifyConfig *config.CulpritNotifyConfig) (*MarkdownFormatter, error)

NewMarkdownFormatter return a new MarkdownFormatter.

func (MarkdownFormatter) GetSubjectAndBody

func (f MarkdownFormatter) GetSubjectAndBody(ctx context.Context, culprit *pb.Culprit,
	subscription *sub_pb.Subscription) (string, string, error)

FormatNewCulprit implements Formatter.

type NoopFormatter

type NoopFormatter struct {
}

NoopFormatter implements Formatter by doing nothing.

func NewNoopFormatter

func NewNoopFormatter() *NoopFormatter

NewNoopFormatter returns a new EmailService instance.

func (*NoopFormatter) GetSubjectAndBody

func (f *NoopFormatter) GetSubjectAndBody(ctx context.Context, culprit *pb.Culprit,
	subscription *sub_pb.Subscription) (string, string, error)

SendNewCulprit implements Formatter.

type TemplateContext

type TemplateContext struct {
	// Commit is the Commit the regression was found at.
	Commit *pb.Commit

	// CommitURL is a URL that points to the above Commit.
	// e.g.
	CommitUrl string

	// Subscription is the configuration which tells where/how to file the bug
	Subscription *sub_pb.Subscription
}

TemplateContext is used in expanding the message templates.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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