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 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 EVTSDKInstall = EventTypePrefix + "sdk-install" // type EventMsg with Data type xsapiv1.SDKManagementMsg EVTSDKRemove = EventTypePrefix + "sdk-remove" // type EventMsg with Data type xsapiv1.SDKManagementMsg EVTSDKStateChange = EventTypePrefix + "sdk-state-change" // type EventMsg with Data type xsapiv1.SDK )
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
Variables ¶
var EVTAllList = []string{ EVTFolderChange, EVTFolderStateChange, EVTSDKInstall, EVTSDKRemove, EVTSDKStateChange, }
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
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"` 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