compact

package
v0.24.6 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Comment = "comment"
	Markup  = "--"
)

constants for the markup maps in the dl.

Variables

This section is empty.

Functions

func ExtractComment added in v0.24.6

func ExtractComment(markup map[string]any) (ret []string, err error)

extract a comment string or strings from the passed msg markup. returns nil if no comment existed. errors if some data existed that couldn't be interpreted.

func IsUnhandled

func IsUnhandled(e error) bool

func JoinLines

func JoinLines(slice []any) (ret string, okay bool)

type conversion: convert a slice of interfaces to a slice of strings joined with newlines.

func SliceBools

func SliceBools(slice []any) ([]bool, bool)

type conversion: convert a slice containing bool values into a bool slice. returns false if any member of the slice isnt a bool

func SliceFloats

func SliceFloats(slice []any) ([]float64, bool)

type conversion: convert a slice containing float values into a float slice. returns false if any member of the slice isnt a float64

func SliceStrings

func SliceStrings(slice []any) ([]string, bool)

type conversion: convert a slice containing string values into a string slice. returns false if any member of the slice isnt a string

func UserComment

func UserComment(markup map[string]any) (ret []string)

read a user comment from markup, normalizing it as an array of strings

Types

type Message

type Message struct {
	Key    string         // original specified text: "Sig:label:"
	Lede   string         // the leading part of the signature in lowercase
	Labels []string       // parameter names sans colons; the first can be blank ( anonymous )
	Args   []any          // the same length as labels
	Markup map[string]any // from map keys starting with "--"; stored stripped of the dashes.
}

A decoding of a tapestry command. Commands on disk are stored as plain value maps containing a command signature and command data pair; and any number of markup key-value pairs. Signatures start with a capital letter, and contain parameter names separated by colons. Markup keys start with a double dash.

func (*Message) AddMarkup

func (op *Message) AddMarkup(k string, v any)

type Unhandled

type Unhandled string

func (Unhandled) Error

func (u Unhandled) Error() string

Jump to

Keyboard shortcuts

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