Documentation
¶
Index ¶
- func NewComponentIOsFromComponent(c *Component) error
- type Component
- type ComponentConnection
- type ComponentIO
- type ComponentIOType
- type Flo
- func (f *Flo) AddComponent(c *Component) error
- func (f *Flo) AddIO(io *ComponentIO) error
- func (f *Flo) ConnectComponent(outComponentID, outComponentIOID uuid.UUID, ...) error
- func (f *Flo) DeleteComponent(id uuid.UUID) error
- func (f *Flo) DeleteConnection(connectionID uuid.UUID) error
- func (f *Flo) DeleteIO(id uuid.UUID) error
- func (f *Flo) PrettyDump(w io.Writer) error
- func (f *Flo) Render(ctx context.Context, w io.Writer) error
- func (f *Flo) RenderComponent(ctx context.Context, g *jen.Group, c *Component, ...) error
- func (f *Flo) Symbols() map[string]map[string]reflect.Value
- type IOs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Component ¶
type ComponentConnection ¶
type ComponentIO ¶
type ComponentIO struct {
ID uuid.UUID
Name string // autogenerated short id used as variable name.
Type ComponentIOType
RType reflect.Type
IsError bool
ParentID uuid.UUID // Used for back reference.
Connections []*ComponentConnection // Many outgoing but one incoming.
}
func NewComponentIO ¶
func NewComponentIO( name string, typ ComponentIOType, rType reflect.Type, parentID uuid.UUID, ) (*ComponentIO, error)
type ComponentIOType ¶
type ComponentIOType int
const ( ComponentIOTypeUnknown ComponentIOType = iota ComponentIOTypeIN ComponentIOTypeOUT )
func (ComponentIOType) String ¶
func (t ComponentIOType) String() string
type Flo ¶
type Flo struct {
ID uuid.UUID
Name string
Label string
Description string
PkgName string
PkgDescription string
Components map[uuid.UUID]*Component
IOs IOs
// contains filtered or unexported fields
}
Flo is a fancy name for a bidirectional graph with some opionionated rules. It is essentially rendered as a wrapper function declaration. IOs are just the function parameters and return values. Nodes are called components and represent function calls.
func (*Flo) AddComponent ¶
func (*Flo) AddIO ¶
func (f *Flo) AddIO(io *ComponentIO) error
func (*Flo) ConnectComponent ¶
func (f *Flo) ConnectComponent( outComponentID, outComponentIOID uuid.UUID, inComponentID, inComponentIOID uuid.UUID, ) error
ConnectComponent inter connects components or flos.
Rules: 1. flo and component: IN(flo) -> IN(component) and OUT(component) -> OUT(flo). 2. component and component: OUT(component) -> IN(component).
func (*Flo) RenderComponent ¶
Click to show internal directories.
Click to hide internal directories.