Documentation
¶
Overview ¶
Package monitorcmd implements the `monitor` command — the CLI's one streaming command and its experimental JavaScript bot runtime. It runs against the clienv.Cmd seam, so cli (and the mcp/tui frontends) dispatch into it without it importing cli.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Plan ¶
type Plan struct {
DryRun bool `json:"dryRun"`
Subscriptions []PlanSub `json:"subscriptions"`
PublicURL string `json:"wsPublicUrl"`
PrivateURL string `json:"wsPrivateUrl,omitempty"`
RESTBaseURL string `json:"restBaseUrl"`
Auth bool `json:"auth"`
Backfill bool `json:"backfill"`
Where string `json:"where,omitempty"`
Init string `json:"init,omitempty"`
On string `json:"on,omitempty"`
Jq string `json:"jq,omitempty"`
Stateful bool `json:"stateful,omitempty"`
NoReconnect bool `json:"noReconnect,omitempty"`
StreamLogLevel string `json:"streamLogLevel,omitempty"`
// Note is an optional caveat about the plan. Additive and monitor leaves it
// empty; the tui uses it to say its account coverage only resolves at startup.
Note string `json:"note,omitempty"`
}
Plan is the --dry-run document: what would be streamed, from where, with which recovery and script settings — nothing is dialed. It implements textout.TextFormatter (see format.go) so the emitter renders the human plan and marshals this struct in --json mode. Reused by the tui's --dry-run.
func PlanDoc ¶
func PlanDoc(subs []stream.Subscription, baseURL, publicURL, privateURL string, private bool, where, initSrc, onSrc, jqSrc string, stateful, backfill, noReconnect bool, streamLog string) Plan
PlanDoc builds the --dry-run Plan.
func (Plan) FormatText ¶
FormatText renders the --dry-run plan for human output (textout.TextFormatter); the --json path marshals the Plan struct. Empty script rows (where/init/on) and the private URL when public-only are dropped by KVBlock's skip-empty rule.
type PlanSub ¶
type PlanSub struct {
Channel string `json:"channel"`
Symbols []string `json:"symbols,omitempty"`
AccountSeqs []int `json:"accountSeqs,omitempty"`
Intervals []string `json:"intervals,omitempty"`
History int `json:"history,omitempty"`
// Implicit marks a subscription made only to feed a derived channel (the
// trade sub under --candles without --trades): it is real on the wire, but
// its own data lines are suppressed from output.
Implicit bool `json:"implicit,omitempty"`
}
PlanSub is one subscription line of a Plan. The synthesized candle channel appears as its own entry carrying Intervals (and History when requested), alongside the wire trade subscription that feeds it.