Documentation
¶
Overview ¶
Package typeinfo describes tapestry autogenerated structures. It follows closely from tapestry typespecs: The typespecs describes the user specification ( in .ifspec, or .idl files ) while the typeinfo describes the golang structures derived from those specs. unless otherwise specified, names are in "lower_case" format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FriendlyName ¶
change one_two into "One two" fix: move to inflect?
Types ¶
type Flow ¶
type Flow struct {
Name string // unique name for this type
Lede string // the compact format leading text
Slots []*Slot // interfaces that a command implements
Terms []Term // terms of the command
Markup map[string]any // metadata shared by all instances of this type
}
tbd: add groups to flow? ( and other types; maybe then a wrapped spec struct for Name, Groups, and Markup )
func (*Flow) TypeMarkup ¶
type Instance ¶
type Instance interface {
// returns the typeinfo for the instance
TypeInfo() T
}
provides access to typeinfo for auto-generated commands
type Markup ¶
implemented by instances with author specified markup data ( currently, that's only flows )
type Num ¶
type Num struct {
Name string // unique name for this type
Markup map[string]any // metadata shared by all instances of this type
}
func (*Num) TypeMarkup ¶
type Repeats ¶
type Repeats interface {
// slices can return false if their list is empty.
Repeats() bool
}
a marker interface implemented by slices of commands
type Slot ¶
type Slot struct {
Name string // unique name for this type
Markup map[string]any // metadata shared by all instances of this type
}
func (*Slot) TypeMarkup ¶
type Str ¶
type Str struct {
Name string // unique name for this type
Options []string // for enumerations; for plain strings, this is nil.
OptionComments []string // matches options if there are comments; nil otherwise.
Markup map[string]any // metadata shared by all instances of this type
}
func (*Str) FindOption ¶
func (*Str) TypeMarkup ¶
type T ¶
type T interface {
// globally unique name for the type.
TypeName() string
// returns markup data specified in the .tell spec
// ( for instance: comments, blockly presentation information, etc. )
TypeMarkup() map[string]any
}
implemented by each kind of typeinfo ( see: Flow, Slot, Str, and Num. )
type Term ¶
type Term struct {
Name string // go lang name; unique within its flow.
Label string // the compact format signature
Private bool // a member that only exists in memory; never serialized
Optional bool // true when the term can be omitted for instances of the flow.
Repeats bool // true when the term can have multiple values ( all of the same type )
Markup map[string]any // per-term markup
Type T // a pointer to Flow, Slot, Str, or Num; or, nil if private
}
a member of a Flow.
func (Term) IsAnonymous ¶
anonymous terms have empty labels. for instance, in some example command: { Say: "hello" } there is no label after the word say and before the first colon so that first term is considered anonymous.