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)
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
FlagName is a REPL flag name, long or short. Repeated shorthand values are
intentional, eg -a is used by --req-all and --active.
Value string
var FlagActive
var FlagActiveShort
var FlagAll
var FlagArg
var FlagCliAmDbgAddr
var FlagCliDir
var FlagCliDirShort
var FlagCliFile
var FlagCliFileShort
var FlagCliLivepage
var FlagCliLivepageAddr
var FlagCliLogLevel
var FlagCliReqAll
var FlagCliReqAllShort
var FlagCliWatch
var FlagCliWatchShort
var FlagDisconn
var FlagDisconnShort
var FlagFrom
var FlagFromShort
var FlagIdPartial
var FlagIdPartialShort
var FlagIdPrefix
var FlagIdPrefixShort
var FlagIdRegexp
var FlagIdRegexpShort
var FlagIdSuffix
var FlagIdSuffixShort
var FlagInactive
var FlagInactiveShort
var FlagLimit
var FlagLimitShort
var FlagMtimeMax
var FlagMtimeMaxShort
var FlagMtimeMin
var FlagMtimeMinShort
var FlagMtimeStates
var FlagMtimeStatesShort
var FlagParent
var FlagParentShort
var FlagState
var FlagStates
var FlagStatesAll
var FlagStatesAllShort
var FlagStateShort
var FlagStatesShort
var FlagSum
var FlagTime
var FlagTimeShort
var FlagVal
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
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)
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 InspectingCmds(repl *Repl) []*cobra.Command func ListingFlags(cmd *cobra.Command) func MutationCmds(repl *Repl) []*cobra.Command func MutationFlags(repl ReplApi, cmd *cobra.Command, groupCmd bool) func NewRootCommand(repl *Repl, cliArgs, osArgs []string) *cobra.Command
ReplCmds are cmds present only in the REPL, not CLI.
func WaitingCmds(repl *Repl) []*cobra.Command
Package-Level Variables (total 77)
var CmdCheatsheet CmdName var CmdConnect CmdName var CmdGroupAdd CmdName var CmdGroupSet CmdName var CmdInspect CmdName var CmdWhenNot CmdName var CmdWhenTime CmdName
listing
mutations
var FlagCliDir FlagName
CLI flags (root command)
var FlagCliWatch FlagName var FlagDisconn FlagName var FlagIdPrefix FlagName var FlagIdRegexp FlagName var FlagIdSuffix FlagName var FlagInactive FlagName var FlagMtimeMax FlagName var FlagMtimeMin FlagName var FlagParent FlagName
waiting
inspecting
var GroupMutating GroupId var GroupWaiting GroupId
Package-Level Constants (only one)
const APrefix = "am_repl"
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |