Documentation
¶
Index ¶
- Constants
- Variables
- type APIConfig
- type BuilderConfig
- type CloudSyncConfig
- type EventMsg
- type EventRegisterArgs
- type EventUnRegisterArgs
- type ExecArgs
- type ExecExitMsg
- type ExecInMsg
- type ExecOutMsg
- type ExecResult
- type ExecSigResult
- type ExecSignalArgs
- type FolderConfig
- type FolderType
- type PathMapConfig
- type SDK
- type SDKFamilyConfig
- type SDKInstallArgs
- type SDKManagementMsg
- type TargetConfig
- type TargetType
- type TerminalConfig
- type TerminalExitMsg
- type TerminalInMsg
- type TerminalOutMsg
- type TerminalResizeArgs
- type TerminalSignalArgs
- type TerminalType
- type Version
Constants ¶
const ( // EventTypePrefix Used as event prefix EventTypePrefix = "event:" // following by event type // Supported Events type EVTAll = EventTypePrefix + "all" EVTFolderChange = EventTypePrefix + "folder-change" // type EventMsg with Data type xsapiv1.FolderConfig EVTFolderStateChange = EventTypePrefix + "folder-state-change" // type EventMsg with Data type xsapiv1.FolderConfig EVTSDKAdd = EventTypePrefix + "sdk-add" // type EventMsg with Data type xsapiv1.SDK EVTSDKRemove = EventTypePrefix + "sdk-remove" // type EventMsg with Data type xsapiv1.SDK EVTSDKManagement = EventTypePrefix + "sdk-management" // type EventMsg with Data type xsapiv1.SDKManagementMsg EVTSDKStateChange = EventTypePrefix + "sdk-state-change" // type EventMsg with Data type xsapiv1.SDK EVTTargetAdd = EventTypePrefix + "target-add" // type EventMsg with Data type xsapiv1.TargetConfig EVTTargetRemove = EventTypePrefix + "target-remove" // type EventMsg with Data type xsapiv1.TargetConfig EVTTargetStateChange = EventTypePrefix + "target-state-change" // type EventMsg with Data type xsapiv1.TargetConfig EVTTargetTerminalAdd = EventTypePrefix + "target-terminal-add" // type EventMsg with Data type xsapiv1.TerminalConfig EVTTargetTerminalRemove = EventTypePrefix + "target-terminal-remove" // type EventMsg with Data type xsapiv1.TerminalConfig EVTTargetTerminalStateChange = EventTypePrefix + "target-terminal-state-change" // type EventMsg with Data type xsapiv1.TerminalConfig )
EventEvent Event send in WS when an internal event (eg. Syncthing event is received)
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" )
Folder 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{ EVTFolderChange, EVTFolderStateChange, EVTSDKAdd, EVTSDKRemove, EVTSDKManagement, EVTSDKStateChange, EVTTargetAdd, EVTTargetRemove, EVTTargetStateChange, EVTTargetTerminalAdd, EVTTargetTerminalRemove, EVTTargetTerminalStateChange, }
EVTAllList List of all supported events
var FolderConfigUpdatableFields = []string{
"Label", "DefaultSdk", "ClientData",
}
FolderConfigUpdatableFields List fields that can be updated using Update function
Functions ¶
This section is empty.
Types ¶
type APIConfig ¶
type APIConfig struct { ServerUID string `json:"id"` Version string `json:"version"` APIVersion string `json:"apiVersion"` VersionGitTag string `json:"gitTag"` SupportedSharing map[string]bool `json:"supportedSharing"` Builder BuilderConfig `json:"builder"` }
APIConfig parameters (json format) of /config command
type BuilderConfig ¶
type BuilderConfig struct { IP string `json:"ip"` Port string `json:"port"` SyncThingID string `json:"syncThingID"` }
BuilderConfig represents the builder container configuration
type CloudSyncConfig ¶
type CloudSyncConfig struct { SyncThingID string `json:"syncThingID"` // Not exported fields (only used internally) STSvrStatus string `json:"-"` STSvrIsInSync bool `json:"-"` STLocStatus string `json:"-"` STLocIsInSync bool `json:"-"` }
CloudSyncConfig CloudSync (AKA Syncthing) specific data
type EventMsg ¶
type EventMsg struct { Time string `json:"time"` FromSessionID string `json:"sessionID"` // Session ID of client who produce this event Type string `json:"type"` Data interface{} `json:"data"` // Data }
EventMsg Message send
func (*EventMsg) DecodeFolderConfig ¶
func (e *EventMsg) DecodeFolderConfig() (FolderConfig, error)
DecodeFolderConfig Helper to decode Data field type FolderConfig
func (*EventMsg) DecodeSDKEvent ¶ added in v1.1.0
DecodeSDKEvent Helper to decode Data field type SDK
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 ¶
EventRegisterArgs Parameters (json format) of /events/register command
type EventUnRegisterArgs ¶
EventUnRegisterArgs Parameters 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 ExecSigResult ¶
type ExecSigResult struct { Status string `json:"status"` // status OK CmdID string `json:"cmdID"` // command unique ID }
ExecSigResult JSON result of /signal 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 FolderConfig ¶
type FolderConfig struct { ID string `json:"id"` Label string `json:"label"` ClientPath string `json:"path"` Type FolderType `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 // Not exported fields from REST API point of view RootPath string `json:"-"` // Specific data depending on which Type is used DataPathMap PathMapConfig `json:"dataPathMap,omitempty"` DataCloudSync CloudSyncConfig `json:"dataCloudSync,omitempty"` }
FolderConfig is the config for one folder
type PathMapConfig ¶
type PathMapConfig struct { ServerPath string `json:"serverPath"` // Don't keep temporary file name (IOW we don't want to save it and reuse it) CheckFile string `json:"checkFile" xml:"-"` CheckContent string `json:"checkContent" xml:"-"` }
PathMapConfig Path mapping specific data
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"` // Not exported fields FamilyConf SDKFamilyConfig `json:"-"` }
SDK Define a cross tool chain used to build application
type SDKFamilyConfig ¶
type SDKFamilyConfig struct { FamilyName string `json:"familyName"` Description string `json:"description"` RootDir string `json:"rootDir"` EnvSetupFile string `json:"envSetupFilename"` ScriptsDir string `json:"scriptsDir"` }
SDKFamilyConfig Configuration structure to define a SDKs family
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 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