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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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