Documentation
¶
Index ¶
- Constants
- func BuildFirmwareEnvelope(ctx context.Context, envelope EnvelopeOptions, device DeviceOptions, ...) (*os.File, error)
- func CheckPort(port string) (string, error)
- func CheckUpToDate(info Info)
- func CompileCmd() *cobra.Command
- func ConfigAnalyticsCmd() *cobra.Command
- func ConfigCmd(info Info) *cobra.Command
- func ConfigUpToDateCmd(info Info) *cobra.Command
- func ConfigWifiCmd() *cobra.Command
- func ConfiguredPort() string
- func ContainerCmd() *cobra.Command
- func ContainerInstallCmd() *cobra.Command
- func ContainerListCmd() *cobra.Command
- func ContainerUninstallCmd() *cobra.Command
- func DecodeCmd() *cobra.Command
- func DownloadEnvelope(ctx context.Context, path string, version string, tmpDir string) (string, error)
- func ExtractFirmware(ctx context.Context, sdk *SDK, envelopePath string, format string, ...) (*os.File, error)
- func ExtractFirmwareBin(ctx context.Context, sdk *SDK, envelopePath string, ...) (*os.File, error)
- func FirmwareCmd() *cobra.Command
- func FirmwareExtractCmd() *cobra.Command
- func FirmwareUpdateCmd() *cobra.Command
- func FlashCmd() *cobra.Command
- func GetCachedFirmwareEnvelopePath(ctx context.Context, version string, model string) (string, error)
- func GetFirmwareEnvelopeFileName(model string) string
- func GetPort(cfg *viper.Viper, all bool, reset bool) (string, error)
- func GetProgramAssetsPath(flags *pflag.FlagSet, flagName string) (string, error)
- func GetRandomName(id []byte) string
- func GetUuid(filename string) (uuid.UUID, error)
- func InstallFile(cmd *cobra.Command, device Device, sdk *SDK, name string, path string, ...) error
- func IsSnapshot(filename string) bool
- func JagCmd(info Info, isReleaseBuild bool) *cobra.Command
- func MonitorCmd() *cobra.Command
- func PingCmd() *cobra.Command
- func PkgCmd(info Info) *cobra.Command
- func PortCmd() *cobra.Command
- func PortExists(port string) (bool, error)
- func PortSetCmd() *cobra.Command
- func ReadLine() (string, error)
- func ReadPassword() ([]byte, error)
- func RunCmd() *cobra.Command
- func RunFile(cmd *cobra.Command, device Device, sdk *SDK, path string, ...) error
- func ScanCmd() *cobra.Command
- func SetInfo(ctx context.Context, info Info) context.Context
- func SetupCmd(info Info) *cobra.Command
- func SetupSdkCmd(info Info) *cobra.Command
- func SimulateCmd() *cobra.Command
- func ToitCmd() *cobra.Command
- func ToitLspCmd() *cobra.Command
- func VersionCmd(info Info, isReleaseBuild bool) *cobra.Command
- func WatchCmd() *cobra.Command
- type Decoder
- type Device
- type DeviceBase
- func (d DeviceBase) Address() string
- func (d DeviceBase) Chip() string
- func (d DeviceBase) ID() string
- func (d DeviceBase) Name() string
- func (d DeviceBase) SDKVersion() string
- func (d DeviceBase) SetID(id string)
- func (d DeviceBase) SetSDKVersion(version string)
- func (d DeviceBase) Short() string
- func (d DeviceBase) String() string
- func (d DeviceBase) WordSize() int
- type DeviceNetwork
- func (d DeviceNetwork) ContainerList(ctx context.Context, sdk *SDK) (map[string]string, error)
- func (d DeviceNetwork) ContainerUninstall(ctx context.Context, sdk *SDK, name string) error
- func (d DeviceNetwork) Ping(ctx context.Context, sdk *SDK) bool
- func (d DeviceNetwork) SendCode(ctx context.Context, sdk *SDK, request string, b []byte, ...) error
- func (d DeviceNetwork) String() string
- func (d DeviceNetwork) ToJson() map[string]interface{}
- func (d DeviceNetwork) UpdateFirmware(ctx context.Context, sdk *SDK, b []byte) error
- type DeviceOptions
- type Devices
- type Elements
- type EnvelopeOptions
- type HasDataReader
- type Info
- type Port
- type Ports
- type ProgressReader
- type SDK
- func (s *SDK) AssetsTool(ctx context.Context, args ...string) *exec.Cmd
- func (s *SDK) Build(ctx context.Context, device Device, snapshotPath string, assetsPath string) ([]byte, error)
- func (s *SDK) Compile(ctx context.Context, snapshot string, entrypoint string, optimizationLevel int) error
- func (s *SDK) DownloaderInfoPath() string
- func (s *SDK) FirmwareTool(ctx context.Context, args ...string) *exec.Cmd
- func (s *SDK) SnapshotToImage(ctx context.Context, args ...string) *exec.Cmd
- func (s *SDK) Stacktrace(ctx context.Context, args ...string) *exec.Cmd
- func (s *SDK) SystemMessage(ctx context.Context, args ...string) *exec.Cmd
- func (s *SDK) ToitAnalyze(ctx context.Context, args ...string) *exec.Cmd
- func (s *SDK) ToitCompile(ctx context.Context, args ...string) *exec.Cmd
- func (s *SDK) ToitLsp(ctx context.Context, args []string) *exec.Cmd
- func (s *SDK) ToitPath() string
- func (s *SDK) ToitRun(ctx context.Context, args ...string) *exec.Cmd
- func (s *SDK) ToitRunSnapshot(ctx context.Context, args ...string) *exec.Cmd
- func (s *SDK) VersionPath() string
- type Short
- type UpdateToDate
Constants ¶
View Source
const ( WifiCfgKey = "wifi" WifiSSIDCfgKey = "ssid" WifiPasswordCfgKey = "password" )
View Source
const ( JaguarDeviceIDHeader = "X-Jaguar-Device-ID" JaguarSDKVersionHeader = "X-Jaguar-SDK-Version" JaguarDisabledHeader = "X-Jaguar-Disabled" JaguarContainerNameHeader = "X-Jaguar-Container-Name" JaguarContainerTimeoutHeader = "X-Jaguar-Container-Timeout" JaguarCRC32Header = "X-Jaguar-CRC32" )
View Source
const (
MagicToken = "Jag15261520"
)
View Source
const UpToDateKey = "up-to-date"
Variables ¶
This section is empty.
Functions ¶
func BuildFirmwareEnvelope ¶ added in v1.6.9
func BuildFirmwareEnvelope(ctx context.Context, envelope EnvelopeOptions, device DeviceOptions, uartEndpointOptions map[string]interface{}) (*os.File, error)
func CheckUpToDate ¶ added in v1.4.4
func CheckUpToDate(info Info)
func CompileCmd ¶ added in v1.2.0
func ConfigAnalyticsCmd ¶ added in v0.3.0
func ConfigUpToDateCmd ¶ added in v1.4.4
func ConfigWifiCmd ¶ added in v1.4.0
func ConfiguredPort ¶ added in v0.1.0
func ConfiguredPort() string
func ContainerCmd ¶ added in v1.5.0
func ContainerInstallCmd ¶ added in v1.5.0
func ContainerListCmd ¶ added in v1.5.0
func ContainerUninstallCmd ¶ added in v1.5.0
func DownloadEnvelope ¶ added in v1.30.0
func ExtractFirmware ¶ added in v1.7.2
func ExtractFirmwareBin ¶ added in v1.7.8
func FirmwareCmd ¶ added in v1.2.0
func FirmwareExtractCmd ¶ added in v1.43.3
func FirmwareUpdateCmd ¶ added in v1.2.0
func GetCachedFirmwareEnvelopePath ¶ added in v1.10.4
func GetCachedFirmwareEnvelopePath(ctx context.Context, version string, model string) (string, error)
GetCachedFirmwareEnvelopePath returns the path to the cached firmware envelope. If necessary, downloads the envelope from the server first.
func GetFirmwareEnvelopeFileName ¶ added in v1.10.4
func GetProgramAssetsPath ¶ added in v1.6.9
func GetRandomName ¶ added in v0.0.5
func InstallFile ¶ added in v1.5.2
func IsSnapshot ¶ added in v1.2.0
Checks whether a file is a snapshot file. Starts by checking for an ar file, since snapshot files are ar files.
func MonitorCmd ¶
func PortExists ¶ added in v0.1.0
func PortSetCmd ¶ added in v0.5.0
func ReadPassword ¶ added in v0.1.0
func SetupSdkCmd ¶ added in v1.6.9
func SimulateCmd ¶
func ToitLspCmd ¶ added in v0.3.0
Types ¶
type Device ¶
type Device interface { ID() string Name() string Chip() string SDKVersion() string WordSize() int Address() string Short() string String() string SetID(string) SetSDKVersion(string) Ping(ctx context.Context, sdk *SDK) bool SendCode(ctx context.Context, sdk *SDK, request string, b []byte, headersMap map[string]string) error ContainerList(ctx context.Context, sdk *SDK) (map[string]string, error) ContainerUninstall(ctx context.Context, sdk *SDK, name string) error UpdateFirmware(ctx context.Context, sdk *SDK, b []byte) error ToJson() map[string]interface{} }
func NewDeviceFromJson ¶ added in v1.42.0
type DeviceBase ¶ added in v1.42.0
type DeviceBase struct {
// contains filtered or unexported fields
}
func (DeviceBase) Address ¶ added in v1.42.0
func (d DeviceBase) Address() string
func (DeviceBase) Chip ¶ added in v1.42.0
func (d DeviceBase) Chip() string
func (DeviceBase) ID ¶ added in v1.42.0
func (d DeviceBase) ID() string
func (DeviceBase) Name ¶ added in v1.42.0
func (d DeviceBase) Name() string
func (DeviceBase) SDKVersion ¶ added in v1.42.0
func (d DeviceBase) SDKVersion() string
func (DeviceBase) SetID ¶ added in v1.42.0
func (d DeviceBase) SetID(id string)
func (DeviceBase) SetSDKVersion ¶ added in v1.42.0
func (d DeviceBase) SetSDKVersion(version string)
func (DeviceBase) Short ¶ added in v1.42.0
func (d DeviceBase) Short() string
func (DeviceBase) String ¶ added in v1.42.0
func (d DeviceBase) String() string
func (DeviceBase) WordSize ¶ added in v1.42.0
func (d DeviceBase) WordSize() int
type DeviceNetwork ¶ added in v1.42.0
type DeviceNetwork struct { DeviceBase // contains filtered or unexported fields }
func NewDeviceNetworkFromJson ¶ added in v1.42.0
func NewDeviceNetworkFromJson(data map[string]interface{}) (*DeviceNetwork, error)
func (DeviceNetwork) ContainerList ¶ added in v1.42.0
func (DeviceNetwork) ContainerUninstall ¶ added in v1.42.0
func (DeviceNetwork) Ping ¶ added in v1.42.0
func (d DeviceNetwork) Ping(ctx context.Context, sdk *SDK) bool
func (DeviceNetwork) String ¶ added in v1.42.0
func (d DeviceNetwork) String() string
func (DeviceNetwork) ToJson ¶ added in v1.42.0
func (d DeviceNetwork) ToJson() map[string]interface{}
func (DeviceNetwork) UpdateFirmware ¶ added in v1.42.0
type DeviceOptions ¶ added in v1.7.0
func (DeviceOptions) GetConfig ¶ added in v1.7.2
func (d DeviceOptions) GetConfig() map[string]interface{}
type EnvelopeOptions ¶ added in v1.7.0
type HasDataReader ¶ added in v1.25.0
type Info ¶ added in v0.1.0
type Ports ¶ added in v0.5.0
type Ports struct {
Ports []Port `mapstructure:"ports" yaml:"ports" json:"ports"`
}
type ProgressReader ¶ added in v1.2.3
type ProgressReader struct {
// contains filtered or unexported fields
}
A Reader based on a byte array that prints a progress bar.
func NewProgressReader ¶ added in v1.2.3
func NewProgressReader(b []byte) *ProgressReader
type SDK ¶
func (*SDK) AssetsTool ¶ added in v1.6.9
func (*SDK) DownloaderInfoPath ¶ added in v1.0.0
func (*SDK) FirmwareTool ¶ added in v1.6.9
func (*SDK) SnapshotToImage ¶ added in v1.4.2
func (*SDK) Stacktrace ¶ added in v1.4.2
func (*SDK) SystemMessage ¶ added in v1.4.2
func (*SDK) ToitAnalyze ¶ added in v1.46.0
func (*SDK) ToitCompile ¶ added in v0.5.1
func (*SDK) ToitRunSnapshot ¶ added in v1.43.3
func (*SDK) VersionPath ¶ added in v0.4.0
type UpdateToDate ¶ added in v1.4.4
Source Files
¶
- compile.go
- config.go
- container.go
- decode.go
- device.go
- device_network.go
- envelope.go
- firmware.go
- firmware_flash.go
- flash.go
- jag.go
- monitor.go
- names.go
- ping.go
- pkg.go
- port.go
- proxy.go
- proxy_device.go
- proxy_multiplexed_reader.go
- proxy_network.go
- run.go
- scan.go
- setup.go
- simulate.go
- toit.go
- util.go
- version.go
- watch.go
Click to show internal directories.
Click to hide internal directories.