drawer

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default() map[string]Generator

Default generators. It's possible to build custom map of generators or/and reuse existing.

Types

type ComponentStmt

type ComponentStmt interface {
	Stmt() string
	ReturnError() bool
}

Represents a statement for adding in a diagram.

func DrawCase

func DrawCase(d Drawer, c types.Component) (ComponentStmt, error)

DrawCase converts a component with type types.CaseComponent to a statement

func DrawDecision

func DrawDecision(d Drawer, c types.Component) (ComponentStmt, error)

DrawDecision converts a component with type types.DecisionComponent to a statement

func DrawSimple

func DrawSimple(d Drawer, c types.Component) (ComponentStmt, error)

DrawSimple converts a component with type types.SimpleComponent to a statement

func DrawWrap

func DrawWrap(d Drawer, c types.Component) (ComponentStmt, error)

DrawWrap converts component with type types.DecisionComponent to a statement

type Drawer

type Drawer interface {
	// Draws a flow. Takes array of components and a failure component and returns dsl in plantuml
	DrawFlow([]types.Component, types.Component) (string, error)

	// DrawComponent generates a statement from a component
	DrawComponent(types.Component) (ComponentStmt, error)

	// DrawBlock generates multi-statement from an array of components
	DrawBlock([]types.Component, types.Component) (ComponentStmt, error)

	// Register is a method for adding a new generator for a custom component type
	Register(string, Generator) error
}

Drawer draws diagram fora business flow

func NewDrawer

func NewDrawer() Drawer

Initializes a new Drawer

type Generator

type Generator func(Drawer, types.Component) (ComponentStmt, error)

Generator converts a component to a statement

Jump to

Keyboard shortcuts

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