Documentation
¶
Overview ¶
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Copyright Consensys Software Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- func NewFormatter() view.TraceFormatting
- type InputHandler
- type InputMode
- type Inspector
- func (p *Inspector) CellAt(col, row uint) termio.FormattedText
- func (p *Inspector) Clock() error
- func (p *Inspector) Close() error
- func (p *Inspector) ColumnWidth(col uint) uint
- func (p *Inspector) CurrentModule() *ModuleState
- func (p *Inspector) Dimensions() (uint, uint)
- func (p *Inspector) EnterMode(mode Mode)
- func (p *Inspector) KeyPressed(key uint16) bool
- func (p *Inspector) Render() error
- func (p *Inspector) SetStatus(msg termio.FormattedText)
- func (p *Inspector) Start() []error
- type Mode
- type ModuleState
- type NavigationMode
- type Query
- func (p *Query) Add(queries ...*Query) *Query
- func (p *Query) And(queries ...*Query) *Query
- func (p *Query) Equals(rhs *Query) *Query
- func (p *Query) Eval(row uint, env QueryEnv) (big.Int, bool)
- func (p *Query) LessThan(rhs *Query) *Query
- func (p *Query) LessThanEquals(rhs *Query) *Query
- func (p *Query) Mul(queries ...*Query) *Query
- func (p *Query) NotEquals(rhs *Query) *Query
- func (p *Query) Number(number big.Int) *Query
- func (p *Query) Or(queries ...*Query) *Query
- func (p *Query) String() string
- func (p *Query) Sub(queries ...*Query) *Query
- func (p *Query) Truth(val bool) *Query
- func (p *Query) Variable(name string) *Query
- type QueryEnv
- type SourceColumnFilter
Constants ¶
const DEFAULT_MODE = 0
DEFAULT_MODE sets the default command bar, and allows the user to navigate the trace.
const NUMERIC_INPUT_MODE = 1
NUMERIC_INPUT_MODE is where the user is entering a numberic value (e.g. to specify the row for a goto command).
const STATUS_MODE = 3
STATUS_MODE means the commandbar is notifying the user with a message for a short period of time.
const TEXT_INPUT_MODE = 2
TEXT_INPUT_MODE is where the user is entering a text value (e.g. for a column filter).
Variables ¶
This section is empty.
Functions ¶
func NewFormatter ¶
func NewFormatter() view.TraceFormatting
NewFormatter constructs a new cell formatter
Types ¶
type InputHandler ¶
type InputHandler[T any] interface { // Convert attempts to convert the input string into a valid value. Convert(string) (T, error) // Apply the given input, which will activate some kind of callback. Apply(T) termio.FormattedText }
InputHandler provides a generic way of handling input, including a mechanism for checking that input is well formed.
type InputMode ¶
type InputMode[T any] struct { // contains filtered or unexported fields }
InputMode is where the user is entering some information (e.g. row for executing a goto command).
func (*InputMode[T]) Activate ¶
Activate navigation mode by setting the command bar to show the navigation commands.
type Inspector ¶
type Inspector struct {
// contains filtered or unexported fields
}
Inspector provides the necessary package
func NewInspector ¶
NewInspector constructs a new inspector on given terminal.
func (*Inspector) CellAt ¶
func (p *Inspector) CellAt(col, row uint) termio.FormattedText
CellAt returns the contents of a given cell in the main table of the inspector.
func (*Inspector) ColumnWidth ¶
ColumnWidth gets the width of a given column in the main table of the inspector. Note that columns here are table columns, not trace columns.
func (*Inspector) CurrentModule ¶
func (p *Inspector) CurrentModule() *ModuleState
CurrentModule returns the currently selected module
func (*Inspector) Dimensions ¶
Dimensions implementation for the TableSource interface
func (*Inspector) KeyPressed ¶
KeyPressed allows the inspector to react to a key being pressed by the user.
func (*Inspector) SetStatus ¶
func (p *Inspector) SetStatus(msg termio.FormattedText)
SetStatus puts a message on the status bar. Messages remain visible for some number of clock cycles.
type Mode ¶
type Mode interface {
// Activate is called when this mode becomes active. This happens when the
// mode is first entered, but can also happen subsequently when a child mode
// exits and results in this mode being reactivated.
Activate(*Inspector)
// Clock is called on every clock tick. This gives the mode an opportunity
// to do something if it wishes to.
Clock(*Inspector)
// KeyPressed in the inspector and received by this mode.
KeyPressed(*Inspector, uint16) bool
}
Mode identifies a mode in which the inspector is operating. The default mode is for navigating the trace, but other modes are available for receiving input from the user or displaying error messages, etc.
type ModuleState ¶
type ModuleState struct {
// contains filtered or unexported fields
}
ModuleState provides state regarding how to display the trace for a given module, including related aspects like filter histories, etc.
type NavigationMode ¶
type NavigationMode struct {
}
NavigationMode is the default mode of the inspector. In this mode, the user is navigating the trace in the normal fashion.
func (*NavigationMode) Activate ¶
func (p *NavigationMode) Activate(parent *Inspector)
Activate navigation mode by setting the command bar to show the navigation commands.
func (*NavigationMode) Clock ¶
func (p *NavigationMode) Clock(parent *Inspector)
Clock navitation mode, which does nothing at this time.
func (*NavigationMode) KeyPressed ¶
func (p *NavigationMode) KeyPressed(parent *Inspector, key uint16) bool
KeyPressed in navigation mode, which either adjusts our view of the trace table or fires off some command.
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query represents a boolean expression which can be evaluated over a given set of columns.
func (*Query) LessThanEquals ¶
LessThanEquals constructs a (non-strict) inequality between two queries.
type QueryEnv ¶
QueryEnv abstracts the notion of an environment for evaluating a query. Specifically, the environment provides a mapping from variable names to their values on a given row.
type SourceColumnFilter ¶
type SourceColumnFilter struct {
// Regex filters columns based on whether their name matches the regex or
// not.
Regex *regexp.Regexp
// Computed filters columns based on whether they are computed.
Computed bool
// UserDefined filters columns based on whether they are non-computed columns.
UserDefined bool
// Register mappin
Mapping register.Map
}
SourceColumnFilter packages up everything needed for filtering columns in a given module.
func (*SourceColumnFilter) Column ¶
func (p *SourceColumnFilter) Column(col view.SourceColumn) bool
Column matches this filter against a given column.
func (*SourceColumnFilter) Range ¶
func (p *SourceColumnFilter) Range() (start, end uint)
Range imoplementation for ModuleFilter interface.