exchange

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package exchange contains functions for converting between different formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodePlayText

func EncodePlayText(ps schema.PatternSet) []string

EncodePlayText encodes a pattern set into a slice of strings in play.txt format.

func LoadFromJSON

func LoadFromJSON(data interface{}, path string) error

LoadFromJSON loads data from JSON file.

func LoadFromLine

func LoadFromLine(path string) ([]string, error)

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

func ParseColor(raw string) (color.Color, error)

ParseColor parses a natural language query string into a color.Color object.

func ParsePlayText

func ParsePlayText(lines []string) (*schema.PatternSet, error)

ParsePlayText parses a slice of strings in play.txt format into a pattern set.

func SaveAsJSON

func SaveAsJSON(data interface{}, path string) error

SaveAsJSON saves data as JSON to the given path.

func SaveAsLine

func SaveAsLine(data []string, path string) error

SaveAsLine saves lines of text to the given path.

func SetLog

func SetLog(l *zap.SugaredLogger)

SetLog sets the logger from outside the package.

Types

This section is empty.

Jump to

Keyboard shortcuts

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