console

package module
v0.0.0-...-f725374 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: Apache-2.0 Imports: 5 Imported by: 1

README

Console

Console is a small wrapper around https://github.com/moby/term exposing a similar interface than the one provided by https://github.com/containerd/console.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAConsole = errors.New("provided file is not a console")
	ErrUnsupported = errors.New("unsupported operation")
)

Functions

This section is empty.

Types

type Console

type Console interface {
	File

	// Resize resizes the console to the provided window size
	Resize(WinSize) error
	// SetRaw sets the console in raw mode
	SetRaw() error
	// DisableEcho disables echo on the console
	DisableEcho() error
	// Reset restores the console to its orignal state
	Reset() error
	// Size returns the window size of the console
	Size() (WinSize, error)
}

func Current

func Current() (c Console)

Current returns the current process' console

func FromFile

func FromFile(f *os.File) (Console, error)

FromFile returns a Console from the provided file

type File

type File interface {
	io.ReadWriteCloser

	// Fd returns its file descriptor
	Fd() uintptr
	// Name returns its file name
	Name() string
}

type WinSize

type WinSize struct {
	// Height of the console
	Height uint16
	// Width of the console
	Width uint16
	// contains filtered or unexported fields
}

WinSize specifies the window size of the console

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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