Documentation
¶
Overview ¶
Package term provides the TTY STDOUT and STDERR interfaces. It is REQUIRED by murex!
Index ¶
- func NewErr(colourise bool) stdio.Io
- func NewIn(dataType string) stdio.Io
- func OutSetDataTypeIPC()
- type Err
- func (t *Err) Close()
- func (t *Err) DefaultDataType(bool)
- func (t *Err) File() *os.File
- func (t *Err) ForceClose()
- func (t *Err) GetDataType() string
- func (t *Err) IsTTY() bool
- func (t *Err) Open()
- func (t *Err) Read([]byte) (int, error)
- func (t *Err) ReadAll() ([]byte, error)
- func (t *Err) ReadArray(context.Context, func([]byte)) error
- func (t *Err) ReadArrayWithType(context.Context, func(interface{}, string)) error
- func (t *Err) ReadLine(func([]byte)) error
- func (t *Err) ReadMap(*config.Config, func(*stdio.Map)) error
- func (t *Err) SetDataType(string)
- func (t *Err) Stats() (bytesWritten, bytesRead uint64)
- func (t *Err) Write(b []byte) (i int, err error)
- func (t *Err) WriteArray(dataType string) (stdio.ArrayWriter, error)
- func (t *Err) WriteTo(io.Writer) (int64, error)
- func (t *Err) Writeln(b []byte) (int, error)
- type ErrRed
- func (t *ErrRed) Close()
- func (t *ErrRed) DefaultDataType(bool)
- func (t *ErrRed) File() *os.File
- func (t *ErrRed) ForceClose()
- func (t *ErrRed) GetDataType() string
- func (t *ErrRed) IsTTY() bool
- func (t *ErrRed) Open()
- func (t *ErrRed) Read([]byte) (int, error)
- func (t *ErrRed) ReadAll() ([]byte, error)
- func (t *ErrRed) ReadArray(context.Context, func([]byte)) error
- func (t *ErrRed) ReadArrayWithType(context.Context, func(interface{}, string)) error
- func (t *ErrRed) ReadLine(func([]byte)) error
- func (t *ErrRed) ReadMap(*config.Config, func(*stdio.Map)) error
- func (t *ErrRed) SetDataType(string)
- func (t *ErrRed) Stats() (bytesWritten, bytesRead uint64)
- func (t *ErrRed) Write(b []byte) (i int, err error)
- func (t *ErrRed) WriteArray(dataType string) (stdio.ArrayWriter, error)
- func (t *ErrRed) WriteTo(io.Writer) (int64, error)
- func (t *ErrRed) Writeln(b []byte) (int, error)
- type In
- type Out
- func (t *Out) Close()
- func (t *Out) DefaultDataType(bool)
- func (t *Out) File() *os.File
- func (t *Out) ForceClose()
- func (t *Out) GetDataType() string
- func (t *Out) IsTTY() bool
- func (t *Out) Open()
- func (t *Out) Read([]byte) (int, error)
- func (t *Out) ReadAll() ([]byte, error)
- func (t *Out) ReadArray(context.Context, func([]byte)) error
- func (t *Out) ReadArrayWithType(context.Context, func(interface{}, string)) error
- func (t *Out) ReadLine(func([]byte)) error
- func (t *Out) ReadMap(*config.Config, func(*stdio.Map)) error
- func (t *Out) SetDataType(dt string)
- func (t *Out) Stats() (bytesWritten, bytesRead uint64)
- func (t *Out) Write(b []byte) (i int, err error)
- func (t *Out) WriteArray(dataType string) (stdio.ArrayWriter, error)
- func (t *Out) WriteTo(io.Writer) (int64, error)
- func (t *Out) Writeln(b []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewErr ¶
NewErr returns either Err or ErrRed depending on whether colourised output was defined via `colorise`
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) 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) ReadArrayWithType ¶
ReadArray is a null method because the term interface is write-only
func (*Err) SetDataType ¶
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) WriteArray ¶
func (t *Err) WriteArray(dataType string) (stdio.ArrayWriter, error)
WriteArray performs data type specific buffered writes to an stdio.Io interface
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) 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) ReadArrayWithType ¶
ReadArray is a null method because the term interface is write-only
func (*ErrRed) SetDataType ¶
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) WriteArray ¶
func (t *ErrRed) WriteArray(dataType string) (stdio.ArrayWriter, error)
WriteArray performs data type specific buffered writes to an stdio.Io interface
type In ¶
In is the Stdin 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
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) 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) ReadArrayWithType ¶
ReadArray is a null method because the term interface is write-only
func (*Out) SetDataType ¶
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) WriteArray ¶
func (t *Out) WriteArray(dataType string) (stdio.ArrayWriter, error)
WriteArray performs data type specific buffered writes to an stdio.Io interface