package repl

Import Path
	/tools/repl (on go.dev)

Dependency Relation
	imports 36 packages, and imported by one package

Involved Source Files cli_repl.go clients_slop.go misc_repl.go Package repl provides a REPL and CLI functionality for aRPC connections.
Package-Level Type Names (total 13)
/* sort by: | */
A is a struct for node arguments. It's a typesafe alternative to [am.A]. Addrs []NamedAddr Args Args Args.ArgsBase am.ArgsBase Args.ArgsBase.ArgsApi machine.ArgsApi Arguments passed to the CLI from the shell Id string Lines []string ListFilters *ListFilters machine ID list of machine IDs Mutation arguments passed from a Cobra cmd handler. RpcCh is a return channel for a list of [rpc.NetworkMachine]. It has to be buffered or the mutation will fail. States []string ( A) ArgsPrefix() string ArgsState is the default Any state. Clone for deep cloning. A : github.com/pancsta/asyncmachine-go/pkg/machine.ArgsApi
Args is shared pkg args for Any state ArgsBase am.ArgsBase ArgsBase.ArgsApi machine.ArgsApi ( Args) ArgsPrefix() string ArgsState is the default Any state. Clone for deep cloning. Args : github.com/pancsta/asyncmachine-go/pkg/machine.ArgsApi
CmdName is a REPL command name. Value string var CmdAdd var CmdCheatsheet var CmdConnect var CmdExit var CmdGroupAdd var CmdGroupRemove var CmdGroupSet var CmdInspect var CmdList var CmdMach var CmdRemove var CmdRoot var CmdScript var CmdSet var CmdStatus var CmdTime var CmdWhen var CmdWhenNot var CmdWhenTime
GroupId is a CLI command group Id. Value string var GroupInspecting var GroupMutating var GroupRepl var GroupWaiting
Dump returns the entire history file. GetLine returns a specific line from the history file. Len returns the number of items in the history file. Write item to history file. *History : github.com/reeflective/readline/internal/history.Source
Block string DateTime time.Time Index int
ListFilters are REPL-specific machine filters, based on [amhelp.MachGroupFilter]. MachGroupFilter amhelp.MachGroupFilter TODO conditions which have to match TODO conditions which cant match MachGroupFilter.IdExact string MachGroupFilter.IdPrefix string MachGroupFilter.IdRegexp *regexp.Regexp MachGroupFilter.IdSubstr string MachGroupFilter.IdSuffix string MachGroupFilter.Limit int MachGroupFilter.MtimeMax uint64 MachGroupFilter.MtimeMin uint64 MachGroupFilter.MtimeStates am.S MachGroupFilter.Parent string MachGroupFilter.StartIdx int MachGroupFilter.StatesActive am.S MachGroupFilter.StatesInactive am.S Include never connected machines Exclude disconnected machines Matches reports whether mach passes all filters. Pagination is not applied. For machines exposing RemoteId (eg rpc.NetworkMachine), the remote ID is matched instead of the local one. func (*Repl).ListMachines(filters *ListFilters) ([]*arpc.Client, error)
NamedAddr is a named machine address. Names are stable across address file refreshes, and Addr may end with /* for WebSockets. Manual addresses are added from the REPL and survive watched address file updates. Addr string Manual bool Name string
Addrs are named addresses, ending with /* for WebSockets. Names are stable across watched address file changes, keeping existing connections. C *console.Console Cmd *cobra.Command am-dbg address for new clients TODO JSON output Mach *am.Machine (*Repl) AddrChangedEnter(e *am.Event) bool (*Repl) AddrChangedState(e *am.Event) (*Repl) CmdAddEnter(e *am.Event) bool (*Repl) CmdAddState(e *am.Event) (*Repl) CmdGroupAddEnter(e *am.Event) bool (*Repl) CmdGroupAddState(e *am.Event) (*Repl) CmdGroupRemoveEnter(e *am.Event) bool (*Repl) CmdGroupRemoveState(e *am.Event) (*Repl) CmdGroupSetEnter(e *am.Event) bool (*Repl) CmdGroupSetState(e *am.Event) (*Repl) CmdRemoveEnter(e *am.Event) bool (*Repl) CmdRemoveState(e *am.Event) (*Repl) CmdSetEnter(e *am.Event) bool (*Repl) CmdSetState(e *am.Event) (*Repl) ConnectedExit(e *am.Event) bool (*Repl) ConnectedFullyEnter(e *am.Event) bool (*Repl) ConnectedFullyExit(e *am.Event) bool (*Repl) ConnectedState(e *am.Event) (*Repl) ConnectingEnter(e *am.Event) bool (*Repl) ConnectingExit(e *am.Event) bool (*Repl) ConnectingState(e *am.Event) (*Repl) DisconnectedState(e *am.Event) (*Repl) DisconnectingState(e *am.Event) (*Repl) ErrNetworkState(e *am.Event) ExceptionState is a final entry handler for the StateException state. ArgsBase: - err error: The error that caused the StateException state. - panic *ExceptionArgsPanic: Optional details about the panic. (*Repl) ListMachines(filters *ListFilters) ([]*arpc.Client, error) (*Repl) ListMachinesEnter(e *am.Event) bool (*Repl) ListMachinesState(e *am.Event) Machine returns the REPL state machine. NetMach returns an RPC worker with a given ID, or nil. NetMachArgs returns a list of registered typed args for a given machine. (*Repl) Print(txt string, args ...any) (*Repl) PrintErr(txt string, args ...any) PrintMsg prints a message about the prompt. (*Repl) ReplModeState(e *am.Event) (*Repl) RpcConnEnter(e *am.Event) bool (*Repl) RpcConnState(e *am.Event) (*Repl) RpcDisconnEnter(e *am.Event) bool (*Repl) RpcDisconnState(e *am.Event) (*Repl) StartEnter(e *am.Event) bool (*Repl) StartState(e *am.Event) *Repl : ReplApi func New(ctx context.Context, id string) (*Repl, error) func InspectingCmds(repl *Repl) []*cobra.Command func MutationCmds(repl *Repl) []*cobra.Command func NewRootCommand(repl *Repl, cliArgs, osArgs []string) *cobra.Command func ReplCmds(repl *Repl) []*cobra.Command func SysCmds(repl *Repl) []*cobra.Command func WaitingCmds(repl *Repl) []*cobra.Command
( ReplApi) NetMachArgs(machId string) []string *Repl func MutationFlags(repl ReplApi, cmd *cobra.Command, groupCmd bool)
type S = am.S ([])
type T = am.Time ([])
Package-Level Functions (total 10)
AddErrSyntax wraps an error in the ErrSyntax sentinel and adds to a machine. TODO align with manual.md version, return am.Result
func MutationCmds(repl *Repl) []*cobra.Command
func MutationFlags(repl ReplApi, cmd *cobra.Command, groupCmd bool)
func New(ctx context.Context, id string) (*Repl, error)
func NewRootCommand(repl *Repl, cliArgs, osArgs []string) *cobra.Command
ReplCmds are cmds present only in the REPL, not CLI.
func SysCmds(repl *Repl) []*cobra.Command
func WaitingCmds(repl *Repl) []*cobra.Command
Package-Level Variables (total 77)
var CmdNames enum.Enum[...]
listing
mutations
CLI flags (root command)
waiting
inspecting
var Pass func(args ...machine.ArgsApi) machine.A
var Sp func(txt string, args ...any) string
Package-Level Constants (only one)
const APrefix = "am_repl"