cli

package
v0.1.84 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cli provides a runtime to for Evy CLI execution in terminal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runtime

type Runtime struct {
	evaluator.UnimplementedRuntime

	SkipSleep bool
	// contains filtered or unexported fields
}

Runtime implements evaluator.Runtime.

func NewRuntime

func NewRuntime() *Runtime

NewRuntime returns an initialized cli runtime.

func (*Runtime) Cls

func (*Runtime) Cls()

Cls clears the screen.

func (*Runtime) Print

func (*Runtime) Print(s string)

Print prints s to stdout.

func (*Runtime) Read

func (rt *Runtime) Read() string

Read reads a line of input from stdin and strips trailing newline.

func (*Runtime) Sleep

func (rt *Runtime) Sleep(dur time.Duration)

Sleep sleeps for dur. If the --skip-sleep flag is used, it does nothing.

func (*Runtime) Yielder

func (*Runtime) Yielder() evaluator.Yielder

Yielder returns a no-op yielder for CLI evy as it is not needed. By contrast, browser Evy needs to explicitly hand over control to JS host with Yielder.

Jump to

Keyboard shortcuts

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