2 * Copyright (C) 2017-2018 "IoT.bzh"
3 * Author Sebastien Douheret <sebastien@iot.bzh>
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
20 // SDK status definition
22 SdkStatusDisable = "Disable"
23 SdkStatusNotInstalled = "Not Installed"
24 SdkStatusInstalling = "Installing"
25 SdkStatusUninstalling = "Un-installing"
26 SdkStatusInstalled = "Installed"
29 // SDK Define a cross tool chain used to build application
31 ID string `json:"id" binding:"required"`
32 Name string `json:"name"`
33 Description string `json:"description"`
34 Profile string `json:"profile"`
35 Version string `json:"version"`
36 Arch string `json:"arch"`
37 Path string `json:"path"`
38 URL string `json:"url"`
39 Status string `json:"status"`
40 Date string `json:"date"`
41 Size string `json:"size"`
42 Md5sum string `json:"md5sum"`
43 SetupFile string `json:"setupFile"`
44 LastError string `json:"lastError"`
46 // Not exported fields
47 FamilyConf SDKFamilyConfig `json:"-"`
50 // SDKFamilyConfig Configuration structure to define a SDKs family
51 type SDKFamilyConfig struct {
52 FamilyName string `json:"familyName"`
53 Description string `json:"description"`
54 RootDir string `json:"rootDir"`
55 EnvSetupFile string `json:"envSetupFilename"`
56 ScriptsDir string `json:"scriptsDir"`
59 // SDKInstallArgs JSON parameters of POST /sdks or /sdks/abortinstall commands
60 type SDKInstallArgs struct {
61 ID string `json:"id"` // install by ID (must be part of GET /sdks result)
62 Filename string `json:"filename"` // install by using a file
63 Force bool `json:"force"` // force SDK install when already existing
64 Timeout int `json:"timeout"` // 1800 == default 30 minutes
65 InstallArgs []string `json:"installArgs"` // args directly passed to add/install script
68 // SDK SDKManagementMsg Actions
70 SdkMgtActionInstall = "installing"
71 SdkMgtActionRemove = "removing"
74 // SDKManagementMsg Message send during SDK installation or when installation is complete
75 type SDKManagementMsg struct {
76 CmdID string `json:"cmdID"`
77 Timestamp string `json:"timestamp"`
78 Action string `json:"action"`
80 Stdout string `json:"stdout"`
81 Stderr string `json:"stderr"`
82 Progress int `json:"progress"` // 0 = not started to 100% = complete
83 Exited bool `json:"exited"`
84 Code int `json:"code"`
85 Error string `json:"error"`