Documentation
¶
Overview ¶
Package exchange contains functions for converting between different formats.
Index ¶
- func EncodePlayText(ps schema.PatternSet) ([]string, error)
- func LoadFromJSON(data interface{}, path string) error
- func LoadFromLine(path string) ([]string, error)
- func LoadPatternFile(fp string) (*schema.PatternSet, error)
- func ParseColor(raw string) (color.Color, error)
- func ParsePlayText(lines []string) (*schema.PatternSet, error)
- func SaveAsJSON(data interface{}, path string) error
- func SaveAsLine(data []string, path string) error
- func SetLog(l *zap.SugaredLogger)
- func ValidatePatternSet(ps schema.PatternSet) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodePlayText ¶
func EncodePlayText(ps schema.PatternSet) ([]string, error)
EncodePlayText emits canonical metadata and explicit compact SDK state data. On failure it returns no lines, so callers can validate before opening files.
func LoadFromJSON ¶
LoadFromJSON loads data from JSON file.
func LoadFromLine ¶
LoadFromLine loads lines of text from the given path.
func LoadPatternFile ¶
func LoadPatternFile(fp string) (*schema.PatternSet, error)
LoadPatternFile loads a pattern file from the given path.
func ParseColor ¶
ParseColor resolves an application random keyword or one configured alias, then delegates a complete color expression to the SDK. Alias keys are exact.
func ParsePlayText ¶
func ParsePlayText(lines []string) (*schema.PatternSet, error)
ParsePlayText reads explicit title:/repeat: metadata and complete SDK states. It returns no PatternSet if any line is malformed or metadata is duplicated.
func SaveAsJSON ¶
SaveAsJSON saves data as JSON to the given path.
func SaveAsLine ¶
SaveAsLine saves lines of text to the given path.
func ValidatePatternSet ¶ added in v0.1.0
func ValidatePatternSet(ps schema.PatternSet) error
ValidatePatternSet checks the application repeat range and delegates every single-state execution rule to the SDK, without opening a device.
Types ¶
This section is empty.