common

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDest

func GetDest(filename string) (io.WriteCloser, error)

GetDest returns an io.WriteCloser for the given filename If filename is empty, returns stdout wrapped in a no-op closer Otherwise opens/creates the file for appending

func GetFormatter

func GetFormatter(format string) formatters.Formatter

GetFormatter returns a formatter based on the plain and markdown flags Returns plain text formatter by default

func NopWriteCloser

func NopWriteCloser(w io.Writer) io.WriteCloser

NopWriteCloser returns an io.WriteCloser that wraps the given io.Writer and has a no-op Close method.

func ParseTimeRange

func ParseTimeRange(start, end string) (coreretriever.TimeRange, error)

ParseTimeRange parses dates given in natural language or other formats and returns a TimeRange struct

func ValidateMessageInput

func ValidateMessageInput(flags MessageInputFlags) error

ValidateMessageInput validates that exactly one message input method is specified

Types

type MessageInputFlags

type MessageInputFlags struct {
	Template     string
	TemplateData string
	Message      string
	MessageFile  string
}

MessageInputFlags represents the flags for message input

type ProcessedMessages

type ProcessedMessages struct {
	Messages map[string]string
	Source   string // "template", "message", or "file"
}

ProcessedMessages contains the processed messages and metadata

func ProcessMessageFlags

func ProcessMessageFlags(
	flags MessageInputFlags,
	recipients []string,
	templateParser func(template, data string) (map[string]string, error),
) (*ProcessedMessages, error)

ProcessMessageFlags processes message input flags and returns processed messages

Jump to

Keyboard shortcuts

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