doc

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	// contains filtered or unexported fields
}

func NewDocument

func NewDocument(w io.Writer, header string) *Document

Creates a new empty document with a title.

func (*Document) Fill

func (d *Document) Fill(obj Interface) error

Fill takes an object with .Describe() method returning []string keys and [][]string rows to fill the document table.

func (*Document) Generate

func (d *Document) Generate() error

Generate generates a new document from the values it contains.

func (*Document) SetDescription

func (d *Document) SetDescription(description string)

SetDescription sets a document description.

func (*Document) SetKeys

func (d *Document) SetKeys(keys ...string)

SetKeys sets keys in the table header.

func (*Document) SetRows

func (d *Document) SetRows(rows [][]string)

SetRows manually sets rows.

type Interface

type Interface interface {
	Describe() ([]string, [][]string, error)
}

Jump to

Keyboard shortcuts

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