Documentation ¶
Index ¶
- Constants
- Variables
- type APIConfig
- type EventMsg
- func (e *EventMsg) DecodeProjectConfig() (ProjectConfig, error)
- func (e *EventMsg) DecodeSDKEvent() (SDK, error)
- func (e *EventMsg) DecodeSDKMgtMsg() (SDKManagementMsg, error)
- func (e *EventMsg) DecodeServerCfg() (ServerCfg, error)
- func (e *EventMsg) DecodeTargetEvent() (TargetConfig, error)
- func (e *EventMsg) DecodeTerminalEvent() (TerminalConfig, error)
- type EventRegisterArgs
- type EventUnRegisterArgs
- type ExecArgs
- type ExecExitMsg
- type ExecInMsg
- type ExecOutMsg
- type ExecResult
- type ExecSignalArgs
- type ExecSignalResult
- type ProjectConfig
- type ProjectType
- type SDK
- type SDKInstallArgs
- type SDKManagementMsg
- type ServerCfg
- type TargetConfig
- type TargetType
- type TerminalConfig
- type TerminalExitMsg
- type TerminalInMsg
- type TerminalOutMsg
- type TerminalResizeArgs
- type TerminalSignalArgs
- type TerminalType
- type VersionData
- type XDSVersion
Constants ¶
const ( // EventTypePrefix Used as event prefix EventTypePrefix = "event:" // following by event type // Supported Events type EVTAll = EventTypePrefix + "all" EVTServerConfig = EventTypePrefix + "server-config" // type EventMsg with Data type xaapiv1.ServerCfg EVTProjectAdd = EventTypePrefix + "project-add" // type EventMsg with Data type xaapiv1.ProjectConfig EVTProjectDelete = EventTypePrefix + "project-delete" // type EventMsg with Data type xaapiv1.ProjectConfig EVTProjectChange = EventTypePrefix + "project-state-change" // type EventMsg with Data type xaapiv1.ProjectConfig EVTSDKAdd = EventTypePrefix + "sdk-add" // type EventMsg with Data type xaapiv1.SDK EVTSDKRemove = EventTypePrefix + "sdk-remove" // type EventMsg with Data type xaapiv1.SDK EVTSDKManagement = EventTypePrefix + "sdk-management" // type EventMsg with Data type xaapiv1.SDKManagementMsg EVTSDKStateChange = EventTypePrefix + "sdk-state-change" // type EventMsg with Data type xaapiv1.SDK EVTTargetAdd = EventTypePrefix + "target-add" // type EventMsg with Data type xaapiv1.TargetConfig EVTTargetRemove = EventTypePrefix + "target-remove" // type EventMsg with Data type xaapiv1.TargetConfig EVTTargetStateChange = EventTypePrefix + "target-state-change" // type EventMsg with Data type xaapiv1.TargetConfig EVTTargetTerminalAdd = EventTypePrefix + "target-terminal-add" // type EventMsg with Data type xaapiv1.TerminalConfig EVTTargetTerminalRemove = EventTypePrefix + "target-terminal-remove" // type EventMsg with Data type xaapiv1.TerminalConfig EVTTargetTerminalStateChange = EventTypePrefix + "target-terminal-state-change" // type EventMsg with Data type xaapiv1.TerminalConfig )
Events Type definitions
const ( // ExecInEvent Event send in WS when characters are sent (stdin) ExecInEvent = "exec:input" // ExecOutEvent Event send in WS when characters are received (stdout or stderr) ExecOutEvent = "exec:output" // ExecExitEvent Event send in WS when program exited ExecExitEvent = "exec:exit" // ExecInferiorInEvent Event send in WS when characters are sent to an inferior (used by gdb inferior/tty) ExecInferiorInEvent = "exec:inferior-input" // ExecInferiorOutEvent Event send in WS when characters are received by an inferior ExecInferiorOutEvent = "exec:inferior-output" )
const ( TypePathMap = "PathMap" TypeCloudSync = "CloudSync" TypeCifsSmb = "CIFS" )
const ( StatusErrorConfig = "ErrorConfig" StatusDisable = "Disable" StatusEnable = "Enable" StatusPause = "Pause" StatusSyncing = "Syncing" )
Project Status definition
const ( SdkStatusDisable = "Disable" SdkStatusNotInstalled = "Not Installed" SdkStatusInstalling = "Installing" SdkStatusUninstalling = "Un-installing" SdkStatusInstalled = "Installed" )
SDK status definition
const ( SdkMgtActionInstall = "installing" SdkMgtActionRemove = "removing" )
SDK SDKManagementMsg Actions
const ( StatusTgtErrorConfig = "ErrorConfig" StatusTgtDisable = "Disable" StatusTgtEnable = "Enable" )
Target Status definition
const ( // TypeTermSSH ssh terminal type TypeTermSSH = "ssh" // StatusTermErrorConfig Configuration error StatusTermErrorConfig = "ErrorConfig" // StatusTermEnable Enable state StatusTermEnable = "Enable" // StatusTermOpen Open state StatusTermOpen = "Open" // StatusTermClose Close state StatusTermClose = "Close" // TerminalInEvent Event send in WS when characters are sent (stdin) TerminalInEvent = "term:input" // TerminalOutEvent Event send in WS when characters are received (stdout or stderr) TerminalOutEvent = "term:output" // TerminalExitEvent Event send in WS on terminal/console exit TerminalExitEvent = "term:exit" )
const (
// TypeTgtStandard Standard target type
TypeTgtStandard = "standard"
)
Variables ¶
var EVTAllList = []string{ EVTServerConfig, EVTProjectAdd, EVTProjectDelete, EVTProjectChange, EVTSDKAdd, EVTSDKRemove, EVTSDKManagement, EVTSDKStateChange, EVTTargetAdd, EVTTargetRemove, EVTTargetStateChange, EVTTargetTerminalAdd, EVTTargetTerminalRemove, EVTTargetTerminalStateChange, }
EVTAllList List of all supported events
var ProjectConfigUpdatableFields = []string{
"Label", "DefaultSdk", "ClientData",
}
ProjectConfigUpdatableFields List fields that can be updated using Update function
Functions ¶
This section is empty.
Types ¶
type APIConfig ¶
type APIConfig struct { Servers []ServerCfg `json:"servers"` // Not exposed outside in JSON Version string `json:"-"` APIVersion string `json:"-"` VersionGitTag string `json:"-"` }
APIConfig parameters (json format) of /config command
type EventMsg ¶
type EventMsg struct { Time string `json:"time"` // Timestamp FromSessionID string `json:"sessionID"` // Session ID of client who produce this event Type string `json:"type"` // Data type Data interface{} `json:"data"` // Data }
EventMsg Event message send over Websocket, data format depend to Type (see DecodeXXX function)
func (*EventMsg) DecodeProjectConfig ¶
func (e *EventMsg) DecodeProjectConfig() (ProjectConfig, error)
DecodeProjectConfig Helper to decode Data field type ProjectConfig
func (*EventMsg) DecodeSDKEvent ¶ added in v1.1.0
DecodeSDKEvent Helper to decode Data field type SDK
func (*EventMsg) DecodeSDKMgtMsg ¶ added in v1.1.0
func (e *EventMsg) DecodeSDKMgtMsg() (SDKManagementMsg, error)
DecodeSDKMgtMsg Helper to decode Data field type SDKManagementMsg
func (*EventMsg) DecodeServerCfg ¶
DecodeServerCfg Helper to decode Data field type ServerCfg
func (*EventMsg) DecodeTargetEvent ¶ added in v1.1.1
func (e *EventMsg) DecodeTargetEvent() (TargetConfig, error)
DecodeTargetEvent Helper to decode Data field type TargetConfig
func (*EventMsg) DecodeTerminalEvent ¶ added in v1.1.1
func (e *EventMsg) DecodeTerminalEvent() (TerminalConfig, error)
DecodeTerminalEvent Helper to decode Data field type TerminalConfig
type EventRegisterArgs ¶
type EventRegisterArgs struct { Name string `json:"name"` ProjectID string `json:"filterProjectID"` }
EventRegisterArgs is the parameters (json format) of /events/register command
type EventUnRegisterArgs ¶
EventUnRegisterArgs is the parameters (json format) of /events/unregister command
type ExecArgs ¶
type ExecArgs struct { ID string `json:"id" binding:"required"` SdkID string `json:"sdkID"` // sdk ID to use for setting env CmdID string `json:"cmdID"` // command unique ID Cmd string `json:"cmd" binding:"required"` Args []string `json:"args"` Env []string `json:"env"` RPath string `json:"rpath"` // relative path into project TTY bool `json:"tty"` // Use a tty, specific to gdb --tty option TTYGdbserverFix bool `json:"ttyGdbserverFix"` // Set to true to activate gdbserver workaround about inferior output ExitImmediate bool `json:"exitImmediate"` // when true, exit event sent immediately when command exited (IOW, don't wait file synchronization) CmdTimeout int `json:"timeout"` // command completion timeout in Second }
ExecArgs JSON parameters of /exec command
type ExecExitMsg ¶
type ExecExitMsg struct { CmdID string `json:"cmdID"` Timestamp string `json:"timestamp"` Code int `json:"code"` Error error `json:"error"` }
ExecExitMsg Message sent when executed command exited
type ExecInMsg ¶
type ExecInMsg struct { CmdID string `json:"cmdID"` Timestamp string `json:"timestamp"` Stdin string `json:"stdin"` }
ExecInMsg Message used to received input characters (stdin)
type ExecOutMsg ¶
type ExecOutMsg struct { CmdID string `json:"cmdID"` Timestamp string `json:"timestamp"` Stdout string `json:"stdout"` Stderr string `json:"stderr"` }
ExecOutMsg Message used to send output characters (stdout+stderr)
type ExecResult ¶
type ExecResult struct { Status string `json:"status"` // status OK CmdID string `json:"cmdID"` // command unique ID }
ExecResult JSON result of /exec command
type ExecSignalArgs ¶
type ExecSignalArgs struct { CmdID string `json:"cmdID" binding:"required"` // command id Signal string `json:"signal" binding:"required"` // signal number }
ExecSignalArgs JSON parameters of /exec/signal command
type ExecSignalResult ¶
type ExecSignalResult struct { Status string `json:"status"` // status OK CmdID string `json:"cmdID"` // command unique ID }
ExecSignalResult JSON result of /signal command
type ProjectConfig ¶
type ProjectConfig struct { ID string `json:"id"` ServerID string `json:"serverId"` Label string `json:"label"` ClientPath string `json:"clientPath"` ServerPath string `json:"serverPath"` Type ProjectType `json:"type"` Status string `json:"status"` IsInSync bool `json:"isInSync"` DefaultSdk string `json:"defaultSdk"` ClientData string `json:"clientData"` // free form field that can used by client }
ProjectConfig is the config for one project
type SDK ¶
type SDK struct { ID string `json:"id" binding:"required"` Name string `json:"name"` Description string `json:"description"` Profile string `json:"profile"` Version string `json:"version"` Arch string `json:"arch"` Path string `json:"path"` URL string `json:"url"` Status string `json:"status"` Date string `json:"date"` Size string `json:"size"` Md5sum string `json:"md5sum"` SetupFile string `json:"setupFile"` LastError string `json:"lastError"` }
SDK Define a cross tool chain used to build application
type SDKInstallArgs ¶
type SDKInstallArgs struct { ID string `json:"id"` // install by ID (must be part of GET /sdks result) Filename string `json:"filename"` // install by using a file Force bool `json:"force"` // force SDK install when already existing Timeout int `json:"timeout"` // 1800 == default 30 minutes InstallArgs []string `json:"installArgs"` // args directly passed to add/install script }
SDKInstallArgs JSON parameters of POST /sdks or /sdks/abortinstall commands
type SDKManagementMsg ¶
type SDKManagementMsg struct { CmdID string `json:"cmdID"` Timestamp string `json:"timestamp"` Action string `json:"action"` Sdk SDK `json:"sdk"` Stdout string `json:"stdout"` Stderr string `json:"stderr"` Progress int `json:"progress"` // 0 = not started to 100% = complete Exited bool `json:"exited"` Code int `json:"code"` Error string `json:"error"` }
SDKManagementMsg Message send during SDK installation or when installation is complete
type ServerCfg ¶
type ServerCfg struct { ID string `json:"id"` URL string `json:"url"` APIURL string `json:"apiUrl"` PartialURL string `json:"partialUrl"` ConnRetry int `json:"connRetry"` Connected bool `json:"connected"` Disabled bool `json:"disabled"` }
ServerCfg .
type TargetConfig ¶ added in v1.1.0
type TargetConfig struct { ID string `json:"id"` Name string `json:"name"` Type TargetType `json:"type"` IP string `json:"ip"` Status string `json:"status"` Terms []TerminalConfig `json:"terms"` }
TargetConfig config of a target / board
type TerminalConfig ¶ added in v1.1.0
type TerminalConfig struct { ID string `json:"id"` Name string `json:"name"` Type TerminalType `json:"type"` User string `json:"user"` Options []string `json:"options"` Status string `json:"status"` Cols uint16 `json:"cols"` Rows uint16 `json:"rows"` }
TerminalConfig config of a board terminal
type TerminalExitMsg ¶ added in v1.1.0
type TerminalExitMsg struct { TermID string `json:"termID"` Timestamp string `json:"timestamp"` Code int `json:"code"` Error error `json:"error"` }
TerminalExitMsg Message sent on terminal/console exit
type TerminalInMsg ¶ added in v1.1.0
type TerminalInMsg struct { TermID string `json:"termID"` Timestamp string `json:"timestamp"` Stdin string `json:"stdin"` }
TerminalInMsg Message used to received input characters (stdin)
type TerminalOutMsg ¶ added in v1.1.0
type TerminalOutMsg struct { TermID string `json:"termID"` Timestamp string `json:"timestamp"` Stdout []byte `json:"stdout"` Stderr []byte `json:"stderr"` }
TerminalOutMsg Message used to send output characters (stdout+stderr)
type TerminalResizeArgs ¶ added in v1.1.0
TerminalResizeArgs JSON parameters of /terminal/:tid/resize command
type TerminalSignalArgs ¶ added in v1.1.0
type TerminalSignalArgs struct {
Signal string `json:"signal" binding:"required"` // signal number
}
TerminalSignalArgs JSON parameters of /terminal/:tid/signal command
type VersionData ¶
type VersionData struct { ID string `json:"id"` Version string `json:"version"` APIVersion string `json:"apiVersion"` VersionGitTag string `json:"gitTag"` }
VersionData
type XDSVersion ¶
type XDSVersion struct { Client VersionData `json:"client"` Server []VersionData `json:"servers"` }
XDSVersion