term

package
v0.0.0-...-e081c89 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package term provides the TTY STDOUT and STDERR interfaces. It is REQUIRED by murex!

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErr

func NewErr(colourise bool) stdio.Io

NewErr returns either Err or ErrRed depending on whether colourised output was defined via `colorise`

func NewIn

func NewIn(dataType string) stdio.Io

func OutSetDataTypeIPC

func OutSetDataTypeIPC()

Types

type Err

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

Err is the Stderr interface for term

func (*Err) Close

func (t *Err) Close()

Close is a null method because the OS standard streams shouldn't be closed

func (*Err) DefaultDataType

func (t *Err) DefaultDataType(bool)

DefaultDataType is a null method because the term interface is write-only

func (*Err) File

func (t *Err) File() *os.File

func (*Err) ForceClose

func (t *Err) ForceClose()

ForceClose is a null method because the OS standard streams shouldn't be closed

func (*Err) GetDataType

func (t *Err) GetDataType() string

GetDataType is a null method because the term interface is write-only

func (*Err) IsTTY

func (t *Err) IsTTY() bool

IsTTY always returns `true` because you are writing to a TTY. All over stream.Io interfaces should return `false`

func (*Err) Open

func (t *Err) Open()

Open is a null method because the OS standard streams shouldn't be closed thus we don't need to track how many times they've been opened

func (*Err) Read

func (t *Err) Read([]byte) (int, error)

Read is a null method because the term interface is write-only

func (*Err) ReadAll

func (t *Err) ReadAll() ([]byte, error)

ReadAll is a null method because the term interface is write-only

func (*Err) ReadArray

func (t *Err) ReadArray(context.Context, func([]byte)) error

ReadArray is a null method because the term interface is write-only

func (*Err) ReadArrayWithType

func (t *Err) ReadArrayWithType(context.Context, func(interface{}, string)) error

ReadArray is a null method because the term interface is write-only

func (*Err) ReadLine

func (t *Err) ReadLine(func([]byte)) error

ReadLine is a null method because the term interface is write-only

func (*Err) ReadMap

func (t *Err) ReadMap(*config.Config, func(*stdio.Map)) error

ReadMap is a null method because the term interface is write-only

func (*Err) SetDataType

func (t *Err) SetDataType(string)

SetDataType is a null method because the term interface is write-only

func (*Err) Stats

func (t *Err) Stats() (bytesWritten, bytesRead uint64)

Stats returns the bytes written and bytes read from the term interface

func (*Err) Write

func (t *Err) Write(b []byte) (i int, err error)

Write is the io.Writer() interface for term

func (*Err) WriteArray

func (t *Err) WriteArray(dataType string) (stdio.ArrayWriter, error)

WriteArray performs data type specific buffered writes to an stdio.Io interface

func (*Err) WriteTo

func (t *Err) WriteTo(io.Writer) (int64, error)

WriteTo is a null method because the term interface is write-only

func (*Err) Writeln

func (t *Err) Writeln(b []byte) (int, error)

Writeln writes an OS-specific terminated line to the stderr

type ErrRed

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

ErrRed is the Stderr interface for term - with output coloured red

func (*ErrRed) Close

func (t *ErrRed) Close()

Close is a null method because the OS standard streams shouldn't be closed

func (*ErrRed) DefaultDataType

func (t *ErrRed) DefaultDataType(bool)

DefaultDataType is a null method because the term interface is write-only

func (*ErrRed) File

func (t *ErrRed) File() *os.File

func (*ErrRed) ForceClose

func (t *ErrRed) ForceClose()

ForceClose is a null method because the OS standard streams shouldn't be closed

func (*ErrRed) GetDataType

func (t *ErrRed) GetDataType() string

GetDataType is a null method because the term interface is write-only

func (*ErrRed) IsTTY

func (t *ErrRed) IsTTY() bool

IsTTY always returns `true` because you are writing to a TTY. All over stream.Io interfaces should return `false`

func (*ErrRed) Open

func (t *ErrRed) Open()

Open is a null method because the OS standard streams shouldn't be closed thus we don't need to track how many times they've been opened

func (*ErrRed) Read

func (t *ErrRed) Read([]byte) (int, error)

Read is a null method because the term interface is write-only

func (*ErrRed) ReadAll

func (t *ErrRed) ReadAll() ([]byte, error)

ReadAll is a null method because the term interface is write-only

func (*ErrRed) ReadArray

func (t *ErrRed) ReadArray(context.Context, func([]byte)) error

ReadArray is a null method because the term interface is write-only

func (*ErrRed) ReadArrayWithType

func (t *ErrRed) ReadArrayWithType(context.Context, func(interface{}, string)) error

ReadArray is a null method because the term interface is write-only

func (*ErrRed) ReadLine

func (t *ErrRed) ReadLine(func([]byte)) error

ReadLine is a null method because the term interface is write-only

func (*ErrRed) ReadMap

func (t *ErrRed) ReadMap(*config.Config, func(*stdio.Map)) error

ReadMap is a null method because the term interface is write-only

func (*ErrRed) SetDataType

func (t *ErrRed) SetDataType(string)

SetDataType is a null method because the term interface is write-only

func (*ErrRed) Stats

func (t *ErrRed) Stats() (bytesWritten, bytesRead uint64)

Stats returns the bytes written and bytes read from the term interface

func (*ErrRed) Write

func (t *ErrRed) Write(b []byte) (i int, err error)

Write is the io.Writer() interface for term

func (*ErrRed) WriteArray

func (t *ErrRed) WriteArray(dataType string) (stdio.ArrayWriter, error)

WriteArray performs data type specific buffered writes to an stdio.Io interface

func (*ErrRed) WriteTo

func (t *ErrRed) WriteTo(io.Writer) (int64, error)

WriteTo is a null method because the term interface is write-only

func (*ErrRed) Writeln

func (t *ErrRed) Writeln(b []byte) (int, error)

Writeln writes an OS-specific terminated line to the stderr

type In

type In struct {
	streams.Stdin
}

In is the Stdin interface for term

func (*In) File

func (t *In) File() *os.File

func (*In) Write

func (t *In) Write(_ []byte) (int, error)

Write is the io.Writer() interface for term

func (*In) WriteArray

func (t *In) WriteArray(_ string) (stdio.ArrayWriter, error)

WriteArray performs data type specific buffered writes to an stdio.Io interface

func (*In) Writeln

func (t *In) Writeln(_ []byte) (int, error)

Writeln writes an OS-specific terminated line to the stdout

type Out

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

Out is the Stdout interface for term

func (*Out) Close

func (t *Out) Close()

Close is a null method because the OS standard streams shouldn't be closed

func (*Out) DefaultDataType

func (t *Out) DefaultDataType(bool)

DefaultDataType is a null method because the term interface is write-only

func (*Out) File

func (t *Out) File() *os.File

func (*Out) ForceClose

func (t *Out) ForceClose()

ForceClose is a null method because the OS standard streams shouldn't be closed

func (*Out) GetDataType

func (t *Out) GetDataType() string

GetDataType is a null method because the term interface is write-only

func (*Out) IsTTY

func (t *Out) IsTTY() bool

IsTTY always returns `true` because you are writing to a TTY. All over stream.Io interfaces should return `false`

func (*Out) Open

func (t *Out) Open()

Open is a null method because the OS standard streams shouldn't be closed thus we don't need to track how many times they've been opened

func (*Out) Read

func (t *Out) Read([]byte) (int, error)

Read is a null method because the term interface is write-only

func (*Out) ReadAll

func (t *Out) ReadAll() ([]byte, error)

ReadAll is a null method because the term interface is write-only

func (*Out) ReadArray

func (t *Out) ReadArray(context.Context, func([]byte)) error

ReadArray is a null method because the term interface is write-only

func (*Out) ReadArrayWithType

func (t *Out) ReadArrayWithType(context.Context, func(interface{}, string)) error

ReadArray is a null method because the term interface is write-only

func (*Out) ReadLine

func (t *Out) ReadLine(func([]byte)) error

ReadLine is a null method because the term interface is write-only

func (*Out) ReadMap

func (t *Out) ReadMap(*config.Config, func(*stdio.Map)) error

ReadMap is a null method because the term interface is write-only

func (*Out) SetDataType

func (t *Out) SetDataType(dt string)

SetDataType writes the data type to a special pipe when run under murex

func (*Out) Stats

func (t *Out) Stats() (bytesWritten, bytesRead uint64)

Stats returns the bytes written and bytes read from the term interface

func (*Out) Write

func (t *Out) Write(b []byte) (i int, err error)

Write is the io.Writer() interface for term

func (*Out) WriteArray

func (t *Out) WriteArray(dataType string) (stdio.ArrayWriter, error)

WriteArray performs data type specific buffered writes to an stdio.Io interface

func (*Out) WriteTo

func (t *Out) WriteTo(io.Writer) (int64, error)

WriteTo is a null method because the term interface is write-only

func (*Out) Writeln

func (t *Out) Writeln(b []byte) (int, error)

Writeln writes an OS-specific terminated line to the stdout

Jump to

Keyboard shortcuts

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