console

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package console provides JavaScript-enabled console environment for interacting with the client. It includes pre-loaded methods that access the node's RPC interface allowing access to the state and condition of the client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompleterManager

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

CompleterManager manages suggestions

type Console

type Console struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Console defines functionalities for create and using an interactive JavaScript console to perform and query the system.

func New

func New(cfg *config.AppConfig) *Console

New creates a new Console instance. signatory is the address

func (*Console) OnStop

func (c *Console) OnStop(f func())

OnStop sets a function that is called when the console is stopped

func (*Console) Prepare

func (c *Console) Prepare() error

Prepare prepares the console and VM

func (*Console) Run

func (c *Console) Run(code ...string) error

Run the console. If execCode is set, it is executed after context is prepared.

func (*Console) SetModulesHub

func (c *Console) SetModulesHub(hub types.ModulesHub)

SetModulesHub sets the system modules hub

func (*Console) Stop

func (c *Console) Stop(immediately bool)

Stop stops console. It saves command history and calls the stop callback

type Executor

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

Executor is responsible for executing operations inside a JavaScript VM.

func (*Executor) OnInput

func (e *Executor) OnInput(in string)

OnInput receives inputs and executes

Jump to

Keyboard shortcuts

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