package repl

Import Path
	github.com/pancsta/asyncmachine-go/tools/repl (on go.dev)

Dependency Relation
	imports 30 packages, and imported by one package

Involved Source Files cli_repl.go misc_repl.go Package repl provides a REPL and CLI functionality for aRPC connections.
Package-Level Type Names (total 7)
/* sort by: | */
A is a struct for node arguments. It's a typesafe alternative to [am.A]. Addrs []string 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.Worker]. It has to be buffered or the mutation will fail. States []string func ParseArgs(args am.A) *A func Pass(args *A) am.A
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
TODO merge with pkg/pubsub and pkg/integrations TODO extract to pkg/helpers.Group IdExact string IdPrefix string IdRegexp *regexp.Regexp IdSubstr string IdSuffix string Limit int MtimeMax uint64 MtimeMin uint64 MtimeStates S Include never connected machines Parent string Exclude disconnected machines StartIdx int StatesActive S StatesInactive S func (*Repl).ListMachines(filters *ListFilters) ([]*rpc.Client, error)
TODO keep NAMED addresses eg CLI0, filename1, filename2, CLI1 and manipulate when watching for changes, keeping the prev ones C *console.Console Cmd *cobra.Command am-dbg address for new clients TODO JSON output Mach *am.Machine (*Repl) AddrChangedEnter(e *am.Event) bool TODO avoid a full restart (*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) CmdRemoveEnter(e *am.Event) bool (*Repl) CmdRemoveState(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. Args: - err error: The error that caused the StateException state. - panic *ExceptionArgsPanic: Optional details about the panic. (*Repl) ListMachines(filters *ListFilters) ([]*rpc.Client, error) (*Repl) ListMachinesEnter(e *am.Event) bool (*Repl) ListMachinesState(e *am.Event) (*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) Worker returns an RPC worker with a given ID, or nil. 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
type S = am.S ([])
type T = am.Time ([])
Package-Level Functions (total 13)
AddErrSyntax wraps an error in the ErrSyntax sentinel and adds to a machine.
LogArgs is an args logger for A and [rpc.A].
func MutationCmds(repl *Repl) []*cobra.Command
func MutationFlags(cmd *cobra.Command, groupCmd bool)
func New(ctx context.Context, id string) (*Repl, error)
func NewRootCommand(repl *Repl, cliArgs, osArgs []string) *cobra.Command
ParseArgs extracts A from [am.Event.Args][APrefix].
Pass prepares [am.A] from A to pass to further mutations.
func ReplCmds(repl *Repl) []*cobra.Command
func SysCmds(repl *Repl) []*cobra.Command
func WaitingCmds(repl *Repl) []*cobra.Command
Package-Level Variables (total 2)
var Sp func(txt string, args ...any) string
Package-Level Constants (only one)
const APrefix = "am_repl"