plain

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package plain provides a line-based backend for interact/ui.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct{}

Backend is a simple line-based backend that works with ordinary IO streams.

func New

func New() *Backend

New creates a plain backend.

func (*Backend) NewSession

func (b *Backend) NewSession(in io.Reader, out io.Writer) (backend.Session, error)

NewSession creates a new plain backend session.

type Session

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

Session implements backend.Session with line-based input.

func (*Session) Close

func (s *Session) Close() error

Close closes the session. Plain sessions do not own IO streams.

func (*Session) ReadEvent

func (s *Session) ReadEvent(ctx context.Context) (backend.Event, error)

ReadEvent reads one line and normalizes it as an enter event.

func (*Session) Render

func (s *Session) Render(view backend.View) error

Render writes the current view as plain text.

func (*Session) Size

func (s *Session) Size() (width, height int)

Size returns zero values because the plain backend does not depend on terminal size.

Jump to

Keyboard shortcuts

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