output

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format string

Format represents the output format

const (
	// FormatText outputs human-readable text
	FormatText Format = "text"
	// FormatJSON outputs JSON
	FormatJSON Format = "json"
	// FormatCSV outputs CSV
	FormatCSV Format = "csv"
	// FormatTemplate outputs using a custom template
	FormatTemplate Format = "template"
)

type Formatter

type Formatter struct {
	// OutputFormat is the output format
	OutputFormat Format
	// Writer is the output writer
	Writer io.Writer
	// Template is the custom template for template format
	Template string
	// NoColor disables color output
	NoColor bool
	// Verbose enables verbose output
	Verbose bool
	// Fields specifies which fields to include in the output
	Fields []string
	// TemplateCache caches parsed templates
	TemplateCache map[string]*template.Template
}

Formatter formats notifications for output

func NewFormatter

func NewFormatter(w io.Writer) *Formatter

NewFormatter creates a new formatter

func (*Formatter) Format

func (f *Formatter) Format(notifications []*github.Notification) error

Format formats notifications for output

func (*Formatter) WithFields

func (f *Formatter) WithFields(fields []string) *Formatter

WithFields sets the fields to include in the output

func (*Formatter) WithFormat

func (f *Formatter) WithFormat(format Format) *Formatter

WithFormat sets the output format

func (*Formatter) WithNoColor

func (f *Formatter) WithNoColor(noColor bool) *Formatter

WithNoColor disables color output

func (*Formatter) WithTemplate

func (f *Formatter) WithTemplate(tmpl string) *Formatter

WithTemplate sets the custom template

func (*Formatter) WithVerbose

func (f *Formatter) WithVerbose(verbose bool) *Formatter

WithVerbose enables verbose output

Jump to

Keyboard shortcuts

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