Documentation
¶
Overview ¶
Package diagram contains tools that can be used to generate ascii diagrams for datadriven tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Whiteboard ¶
type Whiteboard struct {
// contains filtered or unexported fields
}
Whiteboard is a data structure that allows writing text at arbitrary locations on an unbounded area filled with spaces.
THe memory usage is at most O((maxLineIdx-minLineIdx) * (maxColIdx-minColIdx)).
func (*Whiteboard) Indented ¶
func (wb *Whiteboard) Indented(indent int) string
Indented turns the whiteboard into a multi-line string and prepends an indentation on each line.
func (*Whiteboard) String ¶
func (wb *Whiteboard) String() string
String turns the whiteboard into a multi-line string.
func (*Whiteboard) Write ¶
func (wb *Whiteboard) Write(lineIdx, colIdx int, s string)
Write a string at the given line and column index. The indexes are arbitrary and can be negative.
Click to show internal directories.
Click to hide internal directories.