Documentation
¶
Index ¶
- Variables
- type AddCmd
- type AddFlag
- type AddNodeId
- type AddrTypeFlag
- type AutoGoCmd
- type CVAckMessage
- type CVBroadcastMessage
- type CVChildTable
- type CVRouterTable
- type CVUnicastMessage
- type CliHandler
- type CliInstance
- type CliOptions
- type CmdRunner
- type CoapsCmd
- type Command
- type CommandContext
- type ConfigVisualizationCmd
- type CountDownCmd
- type CountFlag
- type CountersCmd
- type DataSizeFlag
- type DebugCmd
- type DefaultFlag
- type DelCmd
- type DemoLegendCmd
- type Empty
- type EnableFlag
- type EnergyCmd
- type EverFlag
- type ExeCmd
- type ExecutableFlag
- type ExitCmd
- type FailTimeParams
- type FieldHeight
- type FieldWidth
- type FullScreen
- type GoCmd
- type GroupId
- type GuiFlag
- type Help
- type HelpCmd
- type HopLimitFlag
- type HostCmd
- type IntervalFlag
- type Ipv6Address
- type JoinsCmd
- type KpiCmd
- type LoadCmd
- type LogLevelCmd
- type MaxSpeedFlag
- type MoveCmd
- type NetInfoCmd
- type NoFlag
- type NodeCmd
- type NodeSelector
- type NodeSelectorSlice
- type NodeTypeOrRole
- type NodesCmd
- type NoneFlag
- type OffFlag
- type OnFlag
- type OnOrOffFlag
- type PartitionsCmd
- type PingCmd
- type PingsCmd
- type PlrCmd
- type RadioCmd
- type RadioModelCmd
- type RadioParamCmd
- type RadioRange
- type RadioRangeFlag
- type RawFlag
- type RestoreFlag
- type RfSimCmd
- type SaveCmd
- type SaveFlag
- type ScanCmd
- type SendCmd
- type SpeedCmd
- type ThreadVersion
- type TimeCmd
- type TitleCmd
- type UnwatchCmd
- type VisualizeArg
- type WatchCmd
- type WebCmd
- type YesFlag
- type YesOrNoFlag
Constants ¶
This section is empty.
Variables ¶
var Cli = newCliInstance()
Functions ¶
This section is empty.
Types ¶
type AddCmd ¶
type AddCmd struct {
Cmd struct{} `"add"` //nolint
Type NodeTypeOrRole `@@` //nolint
X *int `( "x" (@Int|@Float) ` //nolint
Y *int `| "y" (@Int|@Float) ` //nolint
Z *int `| "z" (@Int|@Float) ` //nolint
Id *AddNodeId `| @@` //nolint
RadioRange *RadioRangeFlag `| @@` //nolint
Restore *RestoreFlag `| @@` //nolint
Version *ThreadVersion `| @@` //nolint
Raw *RawFlag `| @@` //nolint
Executable *ExecutableFlag `| @@ )*` //nolint
}
noinspection GoVetStructTag
type AddrTypeFlag ¶
type AddrTypeFlag struct {
Type AddrType `@( "any" | "mleid" | "rloc" | "slaac" | "linklocal" )` //nolint
}
noinspection GoVetStructTag
type AutoGoCmd ¶
type AutoGoCmd struct {
Cmd struct{} `"autogo"` //nolint
Val *YesOrNoFlag `[ @@ ]` // nolint
}
noinspection GoVetStructTag
type CVAckMessage ¶
type CVAckMessage struct {
Flag struct{} `"ack"` //nolint
OnOrOff OnOrOffFlag `@@` //nolint
}
noinspection GoVetStructTag
type CVBroadcastMessage ¶
type CVBroadcastMessage struct {
Flag struct{} `"bro"` //nolint
OnOrOff OnOrOffFlag `@@` //nolint
}
noinspection GoVetStructTag
type CVChildTable ¶
type CVChildTable struct {
Flag struct{} `"ctb"` //nolint
OnOrOff OnOrOffFlag `@@` //nolint
}
noinspection GoVetStructTag
type CVRouterTable ¶
type CVRouterTable struct {
Flag struct{} `"rtb"` //nolint
OnOrOff OnOrOffFlag `@@` //nolint
}
noinspection GoVetStructTag
type CVUnicastMessage ¶
type CVUnicastMessage struct {
Flag struct{} `"uni"` //nolint
OnOrOff OnOrOffFlag `@@` //nolint
}
noinspection GoVetStructTag
type CliHandler ¶
type CliInstance ¶
type CliInstance struct {
Started chan struct{}
Options *CliOptions
// contains filtered or unexported fields
}
CliInstance is the singleton CLI instance
func (*CliInstance) OnStdout ¶
func (cli *CliInstance) OnStdout()
OnStdout is the handler called when new Stdout/Stderr output occurred.
func (*CliInstance) RestorePrompt ¶
func (cli *CliInstance) RestorePrompt()
func (*CliInstance) Run ¶
func (cli *CliInstance) Run(handler CliHandler, options *CliOptions) error
func (*CliInstance) Stop ¶
func (cli *CliInstance) Stop()
type CliOptions ¶
func DefaultCliOptions ¶
func DefaultCliOptions() *CliOptions
type CmdRunner ¶
type CmdRunner struct {
// contains filtered or unexported fields
}
func NewCmdRunner ¶
func NewCmdRunner(ctx *progctx.ProgCtx, sim *simulation.Simulation) *CmdRunner
func (*CmdRunner) GetNodeContext ¶
func (rt *CmdRunner) GetNodeContext() NodeId
func (*CmdRunner) HandleCommand ¶
type CoapsCmd ¶
type CoapsCmd struct {
Cmd struct{} `"coaps"` //nolint
Enable *EnableFlag `@@ ?` //nolint
}
noinspection GoVetStructTag
type Command ¶
type Command struct {
Add *AddCmd ` @@` //nolint
AutoGo *AutoGoCmd `| @@` //nolint
Coaps *CoapsCmd `| @@` //nolint
ConfigVisualization *ConfigVisualizationCmd `| @@` //nolint
CountDown *CountDownCmd `| @@` //nolint
Counters *CountersCmd `| @@` //nolint
Debug *DebugCmd `| @@` //nolint
Del *DelCmd `| @@` //nolint
DemoLegend *DemoLegendCmd `| @@` //nolint
Energy *EnergyCmd `| @@` //nolint
Exe *ExeCmd `| @@` //nolint
Exit *ExitCmd `| @@` //nolint
Go *GoCmd `| @@` //nolint
Help *HelpCmd `| @@` //nolint
Host *HostCmd `| @@` //nolint
Joins *JoinsCmd `| @@` //nolint
Kpi *KpiCmd `| @@` //nolint
Load *LoadCmd `| @@` //nolint
LogLevel *LogLevelCmd `| @@` //nolint
Move *MoveCmd `| @@` //nolint
NetInfo *NetInfoCmd `| @@` //nolint
Node *NodeCmd `| @@` //nolint
Nodes *NodesCmd `| @@` //nolint
Partitions *PartitionsCmd `| @@` //nolint
Ping *PingCmd `| @@` //nolint
Pings *PingsCmd `| @@` //nolint
Plr *PlrCmd `| @@` //nolint
Radio *RadioCmd `| @@` //nolint
RadioModel *RadioModelCmd `| @@` //nolint
RadioParam *RadioParamCmd `| @@` //nolint
RfSim *RfSimCmd `| @@` //nolint
Save *SaveCmd `| @@` //nolint
Scan *ScanCmd `| @@` //nolint
Send *SendCmd `| @@` //nolint
Speed *SpeedCmd `| @@` //nolint
Time *TimeCmd `| @@` //nolint
Title *TitleCmd `| @@` //nolint
Unwatch *UnwatchCmd `| @@` //nolint
Watch *WatchCmd `| @@` //nolint
Web *WebCmd `| @@` //nolint
}
noinspection GoVetStructTag
type CommandContext ¶
func (*CommandContext) Err ¶
func (cc *CommandContext) Err() error
Err returns the last error that occurred during command execution.
type ConfigVisualizationCmd ¶
type ConfigVisualizationCmd struct {
Cmd struct{} `"cv"` //nolint
BroadcastMessage *CVBroadcastMessage `( @@` //nolint
UnicastMessage *CVUnicastMessage `| @@` //nolint
AckMessage *CVAckMessage `| @@` //nolint
RouterTable *CVRouterTable `| @@` //nolint
ChildTable *CVChildTable `| @@ )*` //nolint
}
noinspection GoVetStructTag
type CountDownCmd ¶
type CountDownCmd struct {
Cmd struct{} `"countdown"` //nolint
Seconds int `@Int` //nolint
Text *string `[ @String ]` //nolint
}
noinspection GoVetStructTag
type CountFlag ¶
type CountFlag struct {
Val int `("count" | "c") @Int` //nolint
}
noinspection GoVetStructTag
type CountersCmd ¶
type CountersCmd struct {
Cmd struct{} `"counters"` //nolint
}
noinspection GoVetStructTag
type DataSizeFlag ¶
type DataSizeFlag struct {
Val int `("datasize"|"ds") @Int` //nolint
}
noinspection GoVetStructTag
type DebugCmd ¶
type DebugCmd struct {
Cmd struct{} `"debug"` //nolint
Fail *string `[ @"fail" ]` //nolint
Echo *string `[ "echo" @String ]` //nolint
}
noinspection GoVetStructTag
type DefaultFlag ¶
type DefaultFlag struct {
Dummy struct{} `"default"` //nolint
}
noinspection GoVetStructTag
type DelCmd ¶
type DelCmd struct {
Cmd struct{} `"del"` //nolint
Nodes []NodeSelector `( @@ )+` //nolint
}
noinspection GoVetStructTag
type DemoLegendCmd ¶
type DemoLegendCmd struct {
Cmd struct{} `"demo_legend"` //nolint
Title string `@String` //nolint
X int `@Int` //nolint
Y int `@Int` //nolint
}
noinspection GoVetStructTag
type EnableFlag ¶
type EnableFlag struct {
Dummy struct{} `"enable"` //nolint
}
noinspection GoVetStructTag
type EnergyCmd ¶
type EnergyCmd struct {
Cmd struct{} `"energy"` //nolint
Save *SaveFlag `( @@ )?` //nolint
Name string `@String?` //nolint
}
noinspection GoVetStructTag
type EverFlag ¶
type EverFlag struct {
Dummy struct{} `"ever"` //nolint
}
noinspection GoVetStructTag
type ExeCmd ¶
type ExeCmd struct {
Cmd struct{} `"exe"` //nolint
NodeType NodeTypeOrRole `( @@` //nolint
Default *DefaultFlag `| @@` //nolint
Version ThreadVersion `| @@ )?` //nolint
Path string `[ @String ]` //nolint
}
noinspection GoVetStructTag
type ExecutableFlag ¶
type ExecutableFlag struct {
Dummy struct{} `"exe"` //nolint
Path string `@String` //nolint
}
noinspection GoVetStructTag
type FailTimeParams ¶
type FailTimeParams struct {
Dummy struct{} `"ft"` //nolint
FailDuration float64 `(@Int|@Float)` //nolint
FailInterval float64 `(@Int|@Float)` //nolint
}
noinspection GoVetStructTag
type FieldHeight ¶
type FieldHeight struct {
Val int `"fh" @Int` //nolint
}
noinspection GoVetStructTag
type FieldWidth ¶
type FieldWidth struct {
Val int `"fw" @Int` //nolint
}
noinspection GoVetStructTag
type FullScreen ¶
type FullScreen struct {
FullScreen struct{} `"fs"` //nolint
}
noinspection GoVetStructTag
type GoCmd ¶
type GoCmd struct {
Cmd struct{} `"go"` //nolint
Time string `( @((Int|Float)["h"|"us"|"m"|"ms"|"s"]) ` //nolint
Ever *EverFlag `| @@ )` //nolint
Speed *float64 `[ "speed" (@Int|@Float) ]` //nolint
}
noinspection GoVetStructTag
type HelpCmd ¶
type HelpCmd struct {
Cmd struct{} `"help"` //nolint
HelpTopic string `[ (@Ident) ]` //nolint
}
noinspection GoVetStructTag
type HopLimitFlag ¶
type HopLimitFlag struct {
Val int `("hoplimit" | "hl") @Int` //nolint
}
noinspection GoVetStructTag
type HostCmd ¶
type HostCmd struct {
Cmd struct{} `"host"` //nolint
SubCmd string `@("add"|"del"|"list")` //nolint
Hostname string `[ @String ]` //nolint
IpAddr *Ipv6Address `[ @@ ]` //nolint
Port uint16 `[ @Int ]` //nolint
PortMapped uint16 `[ @Int ]` //nolint
}
noinspection GoVetStructTag
type IntervalFlag ¶
type IntervalFlag struct {
Val float64 `("interval"|"itv") (@Int|@Float)` //nolint
}
noinspection GoVetStructTag
type Ipv6Address ¶
type Ipv6Address struct {
Addr string `@String` //nolint
}
noinspection GoVetStructTag
type JoinsCmd ¶
type JoinsCmd struct {
Cmd struct{} `"joins"` //nolint
}
noinspection GoVetStructTag
type KpiCmd ¶
type KpiCmd struct {
Cmd struct{} `"kpi"` //nolint
Operation string `[ @("start"|"stop"|"save") ]` //nolint
Filename string `[ @String ]` //nolint
}
noinspection GoVetStructTag
type LoadCmd ¶
type LoadCmd struct {
Cmd struct{} `"load"` //nolint
Filename string `@String` //nolint
Add *AddFlag `[ @@ ]` //nolint
}
noinspection GoVetStructTag
type LogLevelCmd ¶
type LogLevelCmd struct {
Cmd struct{} `"log"` //nolint
Level string `[@( "micro"|"trace"|"debug"|"info"|"warn"|"error"|"D"|"I"|"N"|"W"|"C"|"E" )]` //nolint
}
noinspection GoVetStructTag
type MaxSpeedFlag ¶
type MaxSpeedFlag struct {
Dummy struct{} `( "max" | "inf")` //nolint
}
noinspection GoVetStructTag
type MoveCmd ¶
type MoveCmd struct {
Cmd struct{} `"move"` //nolint
Target NodeSelector `@@` //nolint
X int `@Int` //nolint
Y int `@Int` //nolint
Z *int `[ @Int ]` //nolint
}
noinspection GoVetStructTag
type NetInfoCmd ¶
type NetInfoCmd struct {
Cmd struct{} `"netinfo" (` //nolint
Version *string ` "version" @String` //nolint
Commit *string `| "commit" @String )+` //nolint
}
noinspection GoVetStructTag
type NoFlag ¶
type NoFlag struct {
Dummy struct{} `("n"|"no"|"false"|"0")` //nolint
}
noinspection GoVetStructTag
type NodeCmd ¶
type NodeCmd struct {
Cmd struct{} `"node"` //nolint
Node NodeSelector `@@` //nolint
Command *string `[ @String ]` //nolint
}
noinspection GoVetStructTag
type NodeSelector ¶
type NodeSelector struct {
Id int `( @Int` //nolint
All *string `| @"all" )` //nolint
IdRange int `[ "-" @Int ]` //nolint
}
noinspection GoVetStructTag
func (*NodeSelector) String ¶
func (ns *NodeSelector) String() string
type NodeSelectorSlice ¶
type NodeSelectorSlice []NodeSelector
func (NodeSelectorSlice) String ¶
func (ns NodeSelectorSlice) String() string
String creates a string of NodeID numbers from a []NodeSelector.
type NodeTypeOrRole ¶
type NodeTypeOrRole struct {
Val string `@("router"|"reed"|"fed"|"med"|"sed"|"ssed"|"br"|"mtd"|"ftd"|"wifi")` //nolint
}
noinspection GoVetStructTag
type NodesCmd ¶
type NodesCmd struct {
Cmd struct{} `"nodes"` //nolint
}
noinspection GoVetStructTag
type NoneFlag ¶
type NoneFlag struct {
Dummy struct{} `"none"` //nolint
}
noinspection GoVetStructTag
type OnOrOffFlag ¶
noinspection GoVetStructTag
type PartitionsCmd ¶
type PartitionsCmd struct {
Cmd struct{} `( "partitions" | "pts")` //nolint
}
noinspection GoVetStructTag
type PingCmd ¶
type PingCmd struct {
Cmd struct{} `"ping"` //nolint
Src NodeSelector `@@` //nolint
Dst *NodeSelector `( @@` //nolint
AddrType *AddrTypeFlag ` [ @@ ]` //nolint
DstAddr *Ipv6Address `| @@)` //nolint
DataSize *DataSizeFlag `( @@` //nolint
Count *CountFlag `| @@` //nolint
Interval *IntervalFlag `| @@` //nolint
HopLimit *HopLimitFlag `| @@ )*` //nolint
}
noinspection GoVetStructTag
type PingsCmd ¶
type PingsCmd struct {
Cmd struct{} `"pings"` //nolint
}
noinspection GoVetStructTag
type PlrCmd ¶
type PlrCmd struct {
Cmd struct{} `"plr"` //nolint
Val *float64 `[ (@Int|@Float) ]` //nolint
}
noinspection GoVetStructTag
type RadioCmd ¶
type RadioCmd struct {
Cmd struct{} `"radio"` //nolint
Nodes []NodeSelector `( @@ )+` //nolint
On *OnFlag `( @@` //nolint
Off *OffFlag `| @@` //nolint
FailTime *FailTimeParams `| @@ )` //nolint
}
noinspection GoVetStructTag
type RadioModelCmd ¶
type RadioModelCmd struct {
Cmd struct{} `"radiomodel"` //nolint
Model string `[(@Ident|@Int)]` //nolint
}
noinspection GoVetStructTag
type RadioParamCmd ¶
type RadioParamCmd struct {
Cmd struct{} `"radioparam"` //nolint
Param string `[@Ident]` //nolint
Sign string `[@("-"|"+")]` //nolint
Val *float64 `[ (@Int|@Float) ]` //nolint
}
noinspection GoVetStructTag
type RadioRange ¶
type RadioRange struct {
Val int `"rr" @Int` //nolint
}
noinspection GoVetStructTag
type RadioRangeFlag ¶
type RadioRangeFlag struct {
Val int `"rr" @Int` //nolint
}
noinspection GoVetStructTag
type RestoreFlag ¶
type RestoreFlag struct {
Dummy struct{} `"restore"` //nolint
}
noinspection GoVetStructTag
type RfSimCmd ¶
type RfSimCmd struct {
Cmd struct{} `"rfsim"` //nolint
Default *DefaultFlag `[@@|` //nolint
Id *NodeSelector `@@]` //nolint
Param string `[@Ident]` //nolint
Sign string `[@("-"|"+")]` //nolint
Val *int `[ @Int ]` //nolint
}
noinspection GoVetStructTag
type SaveCmd ¶
type SaveCmd struct {
Cmd struct{} `"save"` //nolint
Filename string `@String` //nolint
Operation string `[ @("all"|"topo"|"py") ]` //nolint
}
noinspection GoVetStructTag
type SaveFlag ¶
type SaveFlag struct {
Dummy struct{} `"save"` //nolint
}
noinspection GoVetStructTag
type ScanCmd ¶
type ScanCmd struct {
Cmd struct{} `"scan"` //nolint
Node NodeSelector `@@` // nolint
}
noinspection GoVetStructTag
type SendCmd ¶
type SendCmd struct {
Cmd struct{} `"send"` //nolint
Protocol string `@("udp"|"tcp"|"coap"|"reset")` //nolint
ProtoParam string `[ @("non"|"con") ]?` //nolint
SrcId NodeSelector `@@` //nolint
DstId []NodeSelector `( @@ )*` //nolint
AddrType *AddrTypeFlag `[ @@ ]` //nolint
DataSize *DataSizeFlag `[ @@ ]` //nolint
}
noinspection GoVetStructTag
type SpeedCmd ¶
type SpeedCmd struct {
Cmd struct{} `"speed"` //nolint
Max *MaxSpeedFlag `[ ( @@` //nolint
Speed *float64 `| (@Int|@Float) ) ]` //nolint
}
noinspection GoVetStructTag
type ThreadVersion ¶
type ThreadVersion struct {
Val string `@("v11"|"v12"|"v13"|"v14"|"ccm")` //nolint
}
noinspection GoVetStructTag
type TitleCmd ¶
type TitleCmd struct {
Cmd struct{} `"title"` //nolint
Title string `@String` //nolint
X *int `( "x" (@Int|@Float) ` //nolint
Y *int `| "y" (@Int|@Float) ` //nolint
FontSize *int `| "fs" @Int )*` //nolint
}
noinspection GoVetStructTag
type UnwatchCmd ¶
type UnwatchCmd struct {
Cmd struct{} `"unwatch"` //nolint
Nodes []NodeSelector `( @@ )+` //nolint
}
noinspection GoVetStructTag
type VisualizeArg ¶
type VisualizeArg struct {
Flag struct{} `"v"` //nolint
None *NoneFlag `( @@` //nolint
Gui *GuiFlag `| @@ )` //nolint
}
noinspection GoVetStructTag
type WatchCmd ¶
type WatchCmd struct {
Cmd struct{} `"watch"` //nolint
Default string `[ @("default"|"def") ]` //nolint
Nodes []NodeSelector `[ ( @@ )+ ]` //nolint
Level string `[@( "trace"|"debug"|"info"|"note"|"warn"|"error"|"crit"|"off"|"none"|"T"|"D"|"I"|"N"|"W"|"E"|"C" )]` //nolint
}
noinspection GoVetStructTag
type WebCmd ¶
type WebCmd struct {
Cmd struct{} `"web"` //nolint
TabName *string `@[ "main" | "energy" | "stats" ]` //nolint
}
noinspection GoVetStructTag
type YesFlag ¶
type YesFlag struct {
Dummy struct{} `("y"|"yes"|"true"|"1")` //nolint
}
noinspection GoVetStructTag
type YesOrNoFlag ¶
noinspection GoVetStructTag