display

package
v0.0.0-...-657c4c4 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alignment

type Alignment int
const (
	Left Alignment = iota
	Right
)

type Cell

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

func NewCell

func NewCell(content string) *Cell

type Dimensions

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

func (*Dimensions) TotalWidth

func (d *Dimensions) TotalWidth(p *Padding) int

type Direction

type Direction int
const (
	LeftToRight Direction = iota
	TopToBottom
)

type Display

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

func NewDisplay

func NewDisplay(prompt string) Display

func (*Display) Close

func (d *Display) Close()

type Grid

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

func NewGrid

func NewGrid() *Grid

func NewGridWithOptions

func NewGridWithOptions(o *GridOptions) *Grid

func (*Grid) AddCell

func (g *Grid) AddCell(c *Cell)

func (*Grid) Sort

func (g *Grid) Sort()

type GridOptions

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

func DefaultOptions

func DefaultOptions() *GridOptions

func (*GridOptions) ChangeDirection

func (g *GridOptions) ChangeDirection(direction Direction)

func (*GridOptions) ChangePadding

func (g *GridOptions) ChangePadding(padding *Padding)

type IO

type IO struct {
}

func (*IO) Read

func (i *IO) Read(b []byte) (int, error)

func (*IO) Write

func (o *IO) Write(b []byte) (int, error)

type Padding

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

func NewTextPadding

func NewTextPadding(t string) *Padding

func NewWhitespacePadding

func NewWhitespacePadding(i int) *Padding

func (*Padding) Padding

func (p *Padding) Padding(alignment Alignment) string

func (*Padding) Width

func (p *Padding) Width() int

type Screen

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

func NewScreen

func NewScreen(g *Grid) *Screen

func (*Screen) FitToWidth

func (s *Screen) FitToWidth(max int) error

func (*Screen) Print

func (s *Screen) Print() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳