diagram

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

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.

Jump to

Keyboard shortcuts

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