plain

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 6 Imported by: 0

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