xaapiv1

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
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
	EVTSDKInstall    = EventTypePrefix + "sdk-install"          // type EventMsg with Data type xaapiv1.SDKManagementMsg
	EVTSDKRemove     = EventTypePrefix + "sdk-remove"           // type EventMsg with Data type xaapiv1.SDKManagementMsg
)

Events Type definitions

View Source
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"
)
View Source
const (
	TypePathMap   = "PathMap"
	TypeCloudSync = "CloudSync"
	TypeCifsSmb   = "CIFS"
)
View Source
const (
	StatusErrorConfig = "ErrorConfig"
	StatusDisable     = "Disable"
	StatusEnable      = "Enable"
	StatusPause       = "Pause"
	StatusSyncing     = "Syncing"
)

Project Status definition

View Source
const (
	SdkStatusDisable      = "Disable"
	SdkStatusNotInstalled = "Not Installed"
	SdkStatusInstalling   = "Installing"
	SdkStatusUninstalling = "Un-installing"
	SdkStatusInstalled    = "Installed"
)

SDK status definition

Variables

EVTAllList List of all supported events

View Source
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) DecodeSDKMsg

func (e *EventMsg) DecodeSDKMsg() (SDKManagementMsg, error)

DecodeSDKMsg Helper to decode Data field type SDKManagementMsg

func (*EventMsg) DecodeServerCfg

func (e *EventMsg) DecodeServerCfg() (ServerCfg, error)

DecodeServerCfg Helper to decode Data field type ServerCfg

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

type EventUnRegisterArgs struct {
	Name string `json:"name"`
	ID   int    `json:"id"`
}

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 ProjectType

type ProjectType string

ProjectType definition

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"`
	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 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL