Documentation ¶
Index ¶
- Constants
- func ParseBytes(b []byte, cmd *Command) error
- func Run(cr *CmdRunner, cliOptions *runcli.CliOptions) error
- type AddCmd
- type AddNodeId
- type AddrTypeFlag
- type CVAckMessage
- type CVBroadcastMessage
- type CVChildTable
- type CVRouterTable
- type CVUnicastMessage
- type CmdRunner
- type CoapsCmd
- type Command
- type CommandContext
- type ConfigVisualizationCmd
- type CountDownCmd
- type CountFlag
- type CountersCmd
- type DataSizeFlag
- type DebugCmd
- type DelCmd
- type DemoLegendCmd
- type Empty
- type EnableFlag
- type EverFlag
- type ExecutableFlag
- type ExitCmd
- type FailTimeParams
- type FieldHeight
- type FieldWidth
- type FullScreen
- type GoCmd
- type GuiFlag
- type HopLimitFlag
- type IntervalFlag
- type Ipv6Address
- type JoinsCmd
- type MaxSpeedFlag
- type Move
- type NetInfoCmd
- type NoFlag
- type NodeCmd
- type NodeSelector
- type NodeType
- type NodesCmd
- type NoneFlag
- type OffFlag
- type OnFlag
- type OnOrOffFlag
- type PartitionsCmd
- type PingCmd
- type PingsCmd
- type PlrCmd
- type RadioCmd
- type RadioRange
- type RadioRangeFlag
- type RestoreFlag
- type ScanCmd
- type SpeedCmd
- type TitleCmd
- type VisualizeArg
- type WebCmd
- type YesFlag
- type YesOrNoFlag
Constants ¶
const (
Prompt = "> "
)
Variables ¶
This section is empty.
Functions ¶
func ParseBytes ¶
Types ¶
type AddCmd ¶
type AddCmd struct { Cmd struct{} `"add"` //nolint Type NodeType `@@` //nolint X *int `( "x" (@Int|@Float) ` //nolint Y *int `| "y" (@Int|@Float) ` //nolint Id *AddNodeId `| @@` //nolint RadioRange *RadioRangeFlag `| @@` //nolint Restore *RestoreFlag `| @@` //nolint Executable *ExecutableFlag `| @@ )*` //nolint }
noinspection GoStructTag
type AddrTypeFlag ¶
type AddrTypeFlag struct {
Type AddrType `@( "any" | "mleid" | "rloc" | "aloc" | "linklocal" )` //nolint
}
noinspection GoStructTag
type CVAckMessage ¶
type CVAckMessage struct { Flag struct{} `"ack"` //nolint OnOrOff OnOrOffFlag `@@` //nolint }
noinspection GoStructTag
type CVBroadcastMessage ¶
type CVBroadcastMessage struct { Flag struct{} `"bro"` //nolint OnOrOff OnOrOffFlag `@@` //nolint }
noinspection GoStructTag
type CVChildTable ¶
type CVChildTable struct { Flag struct{} `"ctb"` //nolint OnOrOff OnOrOffFlag `@@` //nolint }
noinspection GoStructTag
type CVRouterTable ¶
type CVRouterTable struct { Flag struct{} `"rtb"` //nolint OnOrOff OnOrOffFlag `@@` //nolint }
noinspection GoStructTag
type CVUnicastMessage ¶
type CVUnicastMessage struct { Flag struct{} `"uni"` //nolint OnOrOff OnOrOffFlag `@@` //nolint }
noinspection GoStructTag
type CmdRunner ¶
type CmdRunner struct {
// contains filtered or unexported fields
}
func NewCmdRunner ¶
func NewCmdRunner(ctx *progctx.ProgCtx, sim *simulation.Simulation) *CmdRunner
func (*CmdRunner) HandleCommand ¶
type CoapsCmd ¶
type CoapsCmd struct { Cmd struct{} `"coaps"` //nolint Enable *EnableFlag `@@ ?` //nolint }
noinspection GoStructTag
type Command ¶
type Command struct { Add *AddCmd ` @@` //nolint Coaps *CoapsCmd `| @@` //nolint ConfigVisualization *ConfigVisualizationCmd `| @@` //nolint CountDown *CountDownCmd `| @@` //nolint Counters *CountersCmd `| @@` //nolint Debug *DebugCmd `| @@` //nolint Del *DelCmd `| @@` //nolint DemoLegend *DemoLegendCmd `| @@` //nolint Exit *ExitCmd `| @@` //nolint Go *GoCmd `| @@` //nolint Joins *JoinsCmd `| @@` //nolint Move *Move `| @@` //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 Scan *ScanCmd `| @@` //nolint Speed *SpeedCmd `| @@` //nolint Title *TitleCmd `| @@` //nolint Web *WebCmd `| @@` //nolint }
noinspection GoStructTag
type CommandContext ¶
func (*CommandContext) Err ¶
func (cc *CommandContext) Err() error
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 GoStructTag
type CountDownCmd ¶
type CountDownCmd struct { Cmd struct{} `"countdown"` //nolint Seconds int `@Int` //nolint Text *string `[ @String ]` //nolint }
noinspection GoStructTag
type CountFlag ¶
type CountFlag struct {
Val int `("count" | "c") @Int` //nolint
}
noinspection GoStructTag
type CountersCmd ¶
type CountersCmd struct {
Cmd struct{} `"counters"` //nolint
}
noinspection GoStructTag
type DataSizeFlag ¶
type DataSizeFlag struct {
Val int `("datasize"|"ds") @Int` //nolint
}
noinspection GoStructTag
type DebugCmd ¶
type DebugCmd struct { Cmd struct{} `"debug"` //nolint Fail *string `[ @"fail" ]` //nolint Echo *string `[ "echo" @String ]` //nolint }
noinspection GoStructTag
type DelCmd ¶
type DelCmd struct { Cmd struct{} `"del"` //nolint Nodes []NodeSelector `( @@ )+` //nolint }
noinspection GoStructTag
type DemoLegendCmd ¶
type DemoLegendCmd struct { Cmd struct{} `"demo_legend"` //nolint Title string `@String` //nolint X int `@Int` //nolint Y int `@Int` //nolint }
noinspection GoStructTag
type EnableFlag ¶
type EnableFlag struct {
Dummy struct{} `"enable"` //nolint
}
type ExecutableFlag ¶
type ExecutableFlag struct { Dummy struct{} `"exe"` //nolint Path string `@String` //nolint }
noinspection GoStructTag
type FailTimeParams ¶
type FailTimeParams struct { Dummy struct{} `"ft"` //nolint FailDuration float64 `(@Int|@Float)` //nolint FailInterval float64 `(@Int|@Float)` //nolint }
noinspection GoStructTag
type FieldHeight ¶
type FieldHeight struct {
Val int `"fh" @Int` //nolint
}
noinspection GoStructTag
type FullScreen ¶
type FullScreen struct {
FullScreen struct{} `"fs"` //nolint
}
noinspection GoStructTag
type GoCmd ¶
type GoCmd struct { Cmd struct{} `"go"` //nolint Seconds float64 `( (@Int|@Float)` //nolint Ever *EverFlag `| @@ )` //nolint Speed *float64 `[ "speed" (@Int|@Float) ]` //nolint }
noinspection GoStructTag
type HopLimitFlag ¶
type HopLimitFlag struct {
Val int `("hoplimit" | "hl") @Int` //nolint
}
noinspection GoStructTag
type IntervalFlag ¶
type IntervalFlag struct {
Val int `("interval"|"itv") @Int` //nolint
}
noinspection GoStructTag
type Ipv6Address ¶
type Ipv6Address struct {
Addr string `@String` //nolint
}
noinspection GoStructTag
type MaxSpeedFlag ¶
type MaxSpeedFlag struct {
Dummy struct{} `( "max" | "inf")` //nolint
}
noinspection MaxSpeedFlag
type Move ¶
type Move struct { Cmd struct{} `"move"` //nolint Target NodeSelector `@@` //nolint X int `@Int` //nolint Y int `@Int` //nolint }
noinspection GoStructTag
type NetInfoCmd ¶
type NetInfoCmd struct { Cmd struct{} `"netinfo" (` //nolint Version *string ` "version" @String` //nolint Commit *string `| "commit" @String` //nolint Real *YesOrNoFlag `| "real" @@ )+` //nolint }
noinspection GoStructTag
type NoFlag ¶
type NoFlag struct {
Dummy struct{} `("n"|"no"|"false"|"0")` //nolint
}
noinspection GoStructTag
type NodeCmd ¶
type NodeCmd struct { Cmd struct{} `"node"` //nolint Node NodeSelector `@@` //nolint Command *string `[ @String ]` //nolint }
noinspection GoStructTag
type NodeSelector ¶
type NodeSelector struct {
Id int `@Int` //nolint
}
noinspection GoStructTag
func (*NodeSelector) String ¶
func (ns *NodeSelector) String() string
type NodeType ¶
type NodeType struct {
Val string `@("router"|"fed"|"med"|"sed")` //nolint
}
noinspection GoStructTag
type OnOrOffFlag ¶
noinspection GoStructTag
type PartitionsCmd ¶
type PartitionsCmd struct {
Cmd struct{} `( "partitions" | "pts")` //nolint
}
noinspection GoStructTag
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 GoStructTag
type PlrCmd ¶
type PlrCmd struct { Cmd struct{} `"plr"` //nolint Val *float64 `[ (@Int|@Float) ]` //nolint }
noinspection GoStructTag
type RadioCmd ¶
type RadioCmd struct { Cmd struct{} `"radio"` //nolint Nodes []NodeSelector `( @@ )+` //nolint On *OnFlag `( @@` //nolint Off *OffFlag `| @@` //nolint FailTime *FailTimeParams `| @@ )` //nolint }
noinspection GoStructTag
type RadioRangeFlag ¶
type RadioRangeFlag struct {
Val int `"rr" @Int` //nolint
}
noinspection GoStructTag
type RestoreFlag ¶
type RestoreFlag struct {
Dummy struct{} `"restore"` //nolint
}
noinspection GoStructTag
type ScanCmd ¶
type ScanCmd struct { Cmd struct{} `"scan"` //nolint Node NodeSelector `@@` // nolint }
noinspection GoStructTag
type SpeedCmd ¶
type SpeedCmd struct { Cmd struct{} `"speed"` //nolint Max *MaxSpeedFlag `( @@` //nolint Speed *float64 `| [ (@Int|@Float) ] )` //nolint }
noinspection GoStructTag
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 GoStructTag
type VisualizeArg ¶
type VisualizeArg struct { Flag struct{} `"v"` //nolint None *NoneFlag `( @@` //nolint Gui *GuiFlag `| @@ )` //nolint }
noinspection GoStructTag
type YesFlag ¶
type YesFlag struct {
Dummy struct{} `("y"|"yes"|"true"|"1")` //nolint
}
noinspection GoStructTag
type YesOrNoFlag ¶
noinspection GoStructTag