Documentation ¶
Index ¶
- func GetSDKInfo(scriptDir, url, filename, md5sum string, log *logrus.Logger) (xsapiv1.SDK, error)
- func ListCrossSDK(scriptDir string, log *logrus.Logger) ([]xsapiv1.SDK, error)
- type APIService
- type ClientSession
- type Context
- type CrossSDK
- func (s *CrossSDK) AbortInstallRemove(timeout int) error
- func (s *CrossSDK) Get() *xsapiv1.SDK
- func (s *CrossSDK) GetEnvCmd() []string
- func (s *CrossSDK) Install(file string, force bool, timeout int, args []string, sess *ClientSession) error
- func (s *CrossSDK) Remove(timeout int, sess *ClientSession) error
- type EventDef
- type Events
- type FolderEventCB
- type FolderEventCBData
- type Folders
- func (f *Folders) Add(newF xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
- func (f *Folders) Delete(id string) (xsapiv1.FolderConfig, error)
- func (f *Folders) ForceSync(id string) error
- func (f *Folders) Get(id string) *IFOLDER
- func (f *Folders) GetConfigArr() []xsapiv1.FolderConfig
- func (f *Folders) IsFolderInSync(id string) (bool, error)
- func (f *Folders) LoadConfig() error
- func (f *Folders) ResolveID(id string) (string, error)
- func (f *Folders) SaveConfig() error
- func (f *Folders) Update(id string, cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
- type IFOLDER
- type PathMap
- func (f *PathMap) Add(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
- func (f *PathMap) ConvPathCli2Svr(s string) string
- func (f *PathMap) ConvPathSvr2Cli(s string) string
- func (f *PathMap) GetConfig() xsapiv1.FolderConfig
- func (f *PathMap) GetFullPath(dir string) string
- func (f *PathMap) IsInSync() (bool, error)
- func (f *PathMap) NewUID(suffix string) string
- func (f *PathMap) Remove() error
- func (f *PathMap) Setup(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
- func (f *PathMap) Sync() error
- func (f *PathMap) Update(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
- type RegisteredCB
- type SDKs
- func (s *SDKs) AbortInstall(id string, timeout int) (*xsapiv1.SDK, error)
- func (s *SDKs) Get(id string) *xsapiv1.SDK
- func (s *SDKs) GetAll() []xsapiv1.SDK
- func (s *SDKs) GetByPath(path string) (*xsapiv1.SDK, error)
- func (s *SDKs) GetEnvCmd(id string, defaultID string) []string
- func (s *SDKs) Install(id, filepath string, force bool, timeout int, args []string, ...) (*xsapiv1.SDK, error)
- func (s *SDKs) Remove(id string, timeout int, sess *ClientSession) (*xsapiv1.SDK, error)
- func (s *SDKs) ResolveID(id string) (string, error)
- func (s *SDKs) Stop()
- type STFolder
- func (f *STFolder) Add(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
- func (f *STFolder) ConvPathCli2Svr(s string) string
- func (f *STFolder) ConvPathSvr2Cli(s string) string
- func (f *STFolder) GetConfig() xsapiv1.FolderConfig
- func (f *STFolder) GetFullPath(dir string) string
- func (f *STFolder) IsInSync() (bool, error)
- func (f *STFolder) NewUID(suffix string) string
- func (f *STFolder) Remove() error
- func (f *STFolder) Setup(fld xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
- func (f *STFolder) Sync() error
- func (f *STFolder) Update(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
- type STFolderDisable
- func (f *STFolderDisable) Add(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
- func (f *STFolderDisable) ConvPathCli2Svr(s string) string
- func (f *STFolderDisable) ConvPathSvr2Cli(s string) string
- func (f *STFolderDisable) GetConfig() xsapiv1.FolderConfig
- func (f *STFolderDisable) GetFullPath(dir string) string
- func (f *STFolderDisable) IsInSync() (bool, error)
- func (f *STFolderDisable) NewUID(suffix string) string
- func (f *STFolderDisable) Remove() error
- func (f *STFolderDisable) Setup(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
- func (f *STFolderDisable) Sync() error
- func (f *STFolderDisable) Update(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
- type Sessions
- type WebServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSDKInfo ¶
GetSDKInfo Used get-sdk-info script to extract SDK get info from a SDK file/tarball
Types ¶
type APIService ¶
type APIService struct { *Context // contains filtered or unexported fields }
APIService .
func NewAPIV1 ¶
func NewAPIV1(ctx *Context) *APIService
NewAPIV1 creates a new instance of API service
type ClientSession ¶
type ClientSession struct { ID string WSID string // only one WebSocket per client/session MaxAge int64 IOSocket *socketio.Socket // contains filtered or unexported fields }
ClientSession contains the info of a user/client session
type Context ¶
type Context struct { ProgName string Cli *cli.Context Config *xdsconfig.Config Log *logrus.Logger LogLevelSilly bool LogSillyf func(format string, args ...interface{}) SThg *st.SyncThing SThgCmd *exec.Cmd SThgInotCmd *exec.Cmd WWWServer *WebServer Exit chan os.Signal // contains filtered or unexported fields }
Context holds the XDS server context
func NewXdsServer ¶
NewXdsServer Create a new instance of XDS server
type CrossSDK ¶
type CrossSDK struct { *Context // contains filtered or unexported fields }
CrossSDK Hold SDK config
func NewCrossSDK ¶
NewCrossSDK creates a new instance of CrossSDK
func (*CrossSDK) AbortInstallRemove ¶
AbortInstallRemove abort an install or remove command
type EventDef ¶
type EventDef struct {
// contains filtered or unexported fields
}
EventDef Definition on one event
type Events ¶
type Events struct { *Context // contains filtered or unexported fields }
Events Hold registered events per context
func (*Events) Register ¶
Register Used by a client/session to register to a specific (or all) event(s)
func (*Events) UnRegister ¶
UnRegister Used by a client/session to un-register event(s)
type FolderEventCB ¶
type FolderEventCB func(cfg *xsapiv1.FolderConfig, data *FolderEventCBData)
type FolderEventCBData ¶
type FolderEventCBData map[string]interface{}
type Folders ¶
type Folders struct { *Context // contains filtered or unexported fields }
Folders Represent a an XDS folders
func FoldersNew ¶
FoldersNew Create a new instance of Model Folders
func (*Folders) Add ¶
func (f *Folders) Add(newF xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
Add adds a new folder
func (*Folders) Delete ¶
func (f *Folders) Delete(id string) (xsapiv1.FolderConfig, error)
Delete deletes a specific folder
func (*Folders) GetConfigArr ¶
func (f *Folders) GetConfigArr() []xsapiv1.FolderConfig
GetConfigArr returns the config of all folders as an array
func (*Folders) IsFolderInSync ¶
IsFolderInSync Returns true when folder is in sync
func (*Folders) LoadConfig ¶
LoadConfig Load folders configuration from disk
func (*Folders) ResolveID ¶
ResolveID Complete a Folder ID (helper for user that can use partial ID value)
func (*Folders) SaveConfig ¶
SaveConfig Save folders configuration to disk
func (*Folders) Update ¶
func (f *Folders) Update(id string, cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
Update Update a specific folder
type IFOLDER ¶
type IFOLDER interface { NewUID(suffix string) string // Get a new folder UUID Add(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error) // Add a new folder Setup(prj xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error) // Local setup of the folder GetConfig() xsapiv1.FolderConfig // Get folder public configuration GetFullPath(dir string) string // Get folder full path ConvPathCli2Svr(s string) string // Convert path from Client to Server ConvPathSvr2Cli(s string) string // Convert path from Server to Client Remove() error // Remove a folder Update(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error) // Update a new folder Sync() error // Force folder files synchronization IsInSync() (bool, error) // Check if folder files are in-sync }
IFOLDER Folder interface
type PathMap ¶
type PathMap struct { *Context // contains filtered or unexported fields }
PathMap .
func NewFolderPathMap ¶
NewFolderPathMap Create a new instance of PathMap
func (*PathMap) Add ¶
func (f *PathMap) Add(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
Add a new folder
func (*PathMap) ConvPathCli2Svr ¶
ConvPathCli2Svr Convert path from Client to Server
func (*PathMap) ConvPathSvr2Cli ¶
ConvPathSvr2Cli Convert path from Server to Client
func (*PathMap) GetConfig ¶
func (f *PathMap) GetConfig() xsapiv1.FolderConfig
GetConfig Get public part of folder config
func (*PathMap) GetFullPath ¶
GetFullPath returns the full path of a directory (from server POV)
func (*PathMap) Setup ¶
func (f *PathMap) Setup(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
Setup Setup local project config
func (*PathMap) Update ¶
func (f *PathMap) Update(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
Update update some fields of a folder
type RegisteredCB ¶
type RegisteredCB struct {
// contains filtered or unexported fields
}
RegisteredCB Hold registered callbacks
type SDKs ¶
type SDKs struct { *Context Sdks map[string]*CrossSDK SdksFamilies map[string]*xsapiv1.SDKFamilyConfig // contains filtered or unexported fields }
SDKs List of installed SDK
func (*SDKs) AbortInstall ¶
AbortInstall Used to abort SDK installation
func (*SDKs) GetEnvCmd ¶
GetEnvCmd returns the command used to initialized the environment for an SDK
func (*SDKs) Install ¶
func (s *SDKs) Install(id, filepath string, force bool, timeout int, args []string, sess *ClientSession) (*xsapiv1.SDK, error)
Install Used to install a new SDK
type STFolder ¶
type STFolder struct { *Context // contains filtered or unexported fields }
STFolder .
func NewFolderST ¶
NewFolderST Create a new instance of STFolder
func (*STFolder) Add ¶
func (f *STFolder) Add(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
Add a new folder
func (*STFolder) ConvPathCli2Svr ¶
ConvPathCli2Svr Convert path from Client to Server
func (*STFolder) ConvPathSvr2Cli ¶
ConvPathSvr2Cli Convert path from Server to Client
func (*STFolder) GetConfig ¶
func (f *STFolder) GetConfig() xsapiv1.FolderConfig
GetConfig Get public part of folder config
func (*STFolder) GetFullPath ¶
GetFullPath returns the full path of a directory (from server POV)
func (*STFolder) Setup ¶
func (f *STFolder) Setup(fld xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
Setup Setup local project config
func (*STFolder) Update ¶
func (f *STFolder) Update(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
Update update some fields of a folder
type STFolderDisable ¶
type STFolderDisable struct { *Context // contains filtered or unexported fields }
STFolderDisable .
func NewFolderSTDisable ¶
func NewFolderSTDisable(ctx *Context) *STFolderDisable
NewFolderSTDisable Create a new instance of STFolderDisable
func (*STFolderDisable) Add ¶
func (f *STFolderDisable) Add(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
Add a new folder
func (*STFolderDisable) ConvPathCli2Svr ¶
func (f *STFolderDisable) ConvPathCli2Svr(s string) string
ConvPathCli2Svr Convert path from Client to Server
func (*STFolderDisable) ConvPathSvr2Cli ¶
func (f *STFolderDisable) ConvPathSvr2Cli(s string) string
ConvPathSvr2Cli Convert path from Server to Client
func (*STFolderDisable) GetConfig ¶
func (f *STFolderDisable) GetConfig() xsapiv1.FolderConfig
GetConfig Get public part of folder config
func (*STFolderDisable) GetFullPath ¶
func (f *STFolderDisable) GetFullPath(dir string) string
GetFullPath returns the full path of a directory (from server POV)
func (*STFolderDisable) IsInSync ¶
func (f *STFolderDisable) IsInSync() (bool, error)
IsInSync Check if folder files are in-sync
func (*STFolderDisable) NewUID ¶
func (f *STFolderDisable) NewUID(suffix string) string
NewUID Get a UUID
func (*STFolderDisable) Setup ¶
func (f *STFolderDisable) Setup(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
Setup Setup local project config
func (*STFolderDisable) Sync ¶
func (f *STFolderDisable) Sync() error
Sync Force folder files synchronization
func (*STFolderDisable) Update ¶
func (f *STFolderDisable) Update(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error)
Update update some fields of a folder
type Sessions ¶
type Sessions struct { *Context // contains filtered or unexported fields }
Sessions holds client sessions
func NewClientSessions ¶
NewClientSessions .
func (*Sessions) Get ¶
func (s *Sessions) Get(c *gin.Context) *ClientSession
Get returns the client session for a specific ID
func (*Sessions) IOSocketGet ¶
IOSocketGet Get socketio definition from sid
func (*Sessions) Middleware ¶
func (s *Sessions) Middleware() gin.HandlerFunc
Middleware is used to managed session
func (*Sessions) UpdateIOSocket ¶
UpdateIOSocket updates the IO Socket definition for of a session