view

package
v0.73.0-alpha2025020401 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package view contains the rendering logic for printing strict controls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Render

type Render interface {
	// List renders the list of controls.
	List(controls strict.Controls) (string, error)

	// DetailControl renders the detailed information about the control, including its subcontrols.
	DetailControl(control strict.Control) (string, error)
}

type Writer

type Writer struct {
	io.Writer
	// contains filtered or unexported fields
}

Writer is the base layer for command views, encapsulating a set of I/O streams and implementing a human friendly view for strict controls.

func NewWriter

func NewWriter(writer io.Writer, render Render) *Writer

NewWriter returns a new `Writer` instance.

func (*Writer) DetailControl

func (writer *Writer) DetailControl(control strict.Control) error

DetailControl renders the detailed information about the control, including its subcontrols.

func (*Writer) List

func (writer *Writer) List(controls strict.Controls) error

List renders the given list of controls.

Directories

Path Synopsis
Package plaintext implements the view.Render interface for displaying strict controls in plaintext format.
Package plaintext implements the view.Render interface for displaying strict controls in plaintext format.

Jump to

Keyboard shortcuts

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