Documentation
¶
Index ¶
- func GetDest(filename string) (io.WriteCloser, error)
- func GetFormatter(format string) formatters.Formatter
- func NopWriteCloser(w io.Writer) io.WriteCloser
- func ParseTimeRange(start, end string) (coreretriever.TimeRange, error)
- func ValidateMessageInput(flags MessageInputFlags) error
- type MessageInputFlags
- type ProcessedMessages
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