Documentation
¶
Overview ¶
Package accountseq centralizes the accountSeq selection policy shared by REST operations and private WebSocket subscriptions.
Index ¶
- Constants
- func Ensure(params []cmdmeta.Param, values map[string]string, def string) (bool, error)
- func MainList() []int
- func MainString() string
- func Param() cmdmeta.Param
- func ParseList(raw string, in Inputs) ([]int, error)
- func Resolve(explicit string, in Inputs) (int, error)
- func ResolveList(explicit []int, in Inputs) ([]int, error)
- func Supports(params []cmdmeta.Param) (cmdmeta.Param, bool)
- type Inputs
Constants ¶
const ( // APIName is the wire parameter name used by REST endpoints. APIName = "accountSeq" // FlagName is the CLI flag name used by endpoint commands. FlagName = "account-seq" // Main is the API's main sub-account sequence number. Main = 1 )
Variables ¶
This section is empty.
Functions ¶
func Ensure ¶
Ensure adds accountSeq to values when the command surface supports it and the caller did not supply it, resolving it through the standard precedence. The resolved value is written to values[APIName] — read it from there. The boolean reports whether the surface has an accountSeq parameter (false => nothing written).
func MainList ¶
func MainList() []int
MainList returns a one-item accountSeqs list for private WebSocket subscriptions.
func ParseList ¶
ParseList parses a comma-separated accountSeq selection (e.g. "1,2,3") into a validated, de-duplicated, order-preserving slice, each element checked through the shared Param (>= 1). A blank input returns (nil, nil) — the caller decides the default set. Order is preserved and duplicates are dropped keeping the first occurrence, because the first element is the one a multi-account session starts active on.
func Resolve ¶
Resolve selects and validates a single accountSeq (REST). Explicit is the user-supplied value ("" when omitted); precedence: explicit → default → Main.
func ResolveList ¶
ResolveList selects accountSeqs for WebSocket subscriptions. Explicit is the user-supplied list (nil/empty when omitted); when empty, it resolves through the standard single-account precedence and wraps the result as a one-element list.