repl

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorPrinter

type ColorPrinter struct {
	*color.Color
}

func NewColorPrinter

func NewColorPrinter() ColorPrinter

func (ColorPrinter) With

func (p ColorPrinter) With(attr ...color.Attribute) Printer

type MonochromePrinter

type MonochromePrinter struct{}

func NewMonochromePrinter

func NewMonochromePrinter() MonochromePrinter

func (MonochromePrinter) Fprint

func (p MonochromePrinter) Fprint(w io.Writer, arg ...interface{}) (int, error)

func (MonochromePrinter) Fprintf

func (p MonochromePrinter) Fprintf(w io.Writer, s string, arg ...interface{}) (int, error)

func (MonochromePrinter) Fprintln

func (p MonochromePrinter) Fprintln(w io.Writer, arg ...interface{}) (int, error)

func (MonochromePrinter) With

type Opts

type Opts struct {
	In         io.Reader
	Out        io.Writer
	Err        io.Writer
	Printer    Printer
	ErrHandler client.ErrorHandler
	HidesNil   bool
}

type Printer

type Printer interface {
	With(...color.Attribute) Printer
	Fprint(io.Writer, ...interface{}) (int, error)
	Fprintln(io.Writer, ...interface{}) (int, error)
	Fprintf(io.Writer, string, ...interface{}) (int, error)
}

func NewPrinter

func NewPrinter(colorEnabled bool) Printer

type Repl

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

func NewRepl

func NewRepl(
	opts *Opts,
	factory func(client.OutputHandler) client.Client,
) *Repl

func (*Repl) Close

func (r *Repl) Close() error

func (*Repl) Debug added in v0.4.0

func (r *Repl) Debug(s string)

func (*Repl) Err

func (r *Repl) Err(s string)

func (*Repl) Eval

func (r *Repl) Eval(code string)

func (*Repl) Interrupt

func (r *Repl) Interrupt()

func (*Repl) Load

func (r *Repl) Load(filename string)

func (*Repl) LoadWithResultVisibility added in v0.2.0

func (r *Repl) LoadWithResultVisibility(filename string, hidesResult bool)

func (*Repl) Out

func (r *Repl) Out(s string)

func (*Repl) Start

func (r *Repl) Start()

func (*Repl) StartWatchingInterruption

func (r *Repl) StartWatchingInterruption()

func (*Repl) SupportsOp

func (r *Repl) SupportsOp(op string) bool

Jump to

Keyboard shortcuts

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