ei

package
v0.0.0-...-fd7302d Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const BASE_EI_URL = "https://build.electricimp.com/"
View Source
const DEVICES_ENDPOINT = "devices"
View Source
const DEVICES_LOG_ENDPOINT = "logs"
View Source
const DEVICES_RESTART_ENDPOINT = "restart"
View Source
const EI_URL = "https://build.electricimp.com/v4/"
View Source
const MODELS_DEVICE_RESTART_ENDPOINT = "restart"
View Source
const MODELS_ENDPOINT = "models"
View Source
const MODELS_REVISIONS_ENDPOINT = "revisions"

Variables

This section is empty.

Functions

func Concat

func Concat(a string, b string) string

Types

type BuildClient

type BuildClient struct {
	// contains filtered or unexported fields
}

func NewBuildClient

func NewBuildClient(api_key string) *BuildClient

func (*BuildClient) ContinueDeviceLogs

func (m *BuildClient) ContinueDeviceLogs(poll_url string) ([]DeviceLogEntry, error)

func (*BuildClient) CreateModel

func (m *BuildClient) CreateModel(new_model *Model) (*Model, error)

func (*BuildClient) DeleteDevice

func (m *BuildClient) DeleteDevice(device_id string) error

func (*BuildClient) DeleteModel

func (m *BuildClient) DeleteModel(model_id string) error

func (*BuildClient) GetCodeRevision

func (m *BuildClient) GetCodeRevision(model_id string, build_num string) (CodeRevisionLong, error)

func (*BuildClient) GetCodeRevisionList

func (m *BuildClient) GetCodeRevisionList(model_id string) (
	[]CodeRevisionShort, error)

func (*BuildClient) GetDevice

func (m *BuildClient) GetDevice(device_id string) (Device, error)

func (*BuildClient) GetDeviceList

func (m *BuildClient) GetDeviceList() ([]Device, error)

func (*BuildClient) GetDeviceLogs

func (m *BuildClient) GetDeviceLogs(device_id string) ([]DeviceLogEntry, string, error)

func (*BuildClient) GetModel

func (m *BuildClient) GetModel(model_id string) (*Model, error)

func (*BuildClient) ListModels

func (m *BuildClient) ListModels() (*ModelList, error)

func (*BuildClient) RestartDevice

func (m *BuildClient) RestartDevice(device_id string) error

func (*BuildClient) RestartModelDevices

func (m *BuildClient) RestartModelDevices(model_id string) error

func (BuildClient) SetAuthHeader

func (m BuildClient) SetAuthHeader(request *http.Request)

func (*BuildClient) UpdateCodeRevision

func (m *BuildClient) UpdateCodeRevision(model_id string,
	request *CodeRevisionLong) (*CodeRevisionResponse, error)

func (*BuildClient) UpdateDevice

func (m *BuildClient) UpdateDevice(new_device *Device, device_id string) (Device, error)

func (*BuildClient) UpdateModel

func (m *BuildClient) UpdateModel(model_id string, new_model *Model) (*Model, error)

type BuildError

type BuildError struct {
	Code         string            `json:"code"`
	ShortMessage string            `json:"message_short"`
	FullMessage  string            `json:"message_full"`
	Details      BuildErrorDetails `json:"details"`
}

type BuildErrorDetails

type BuildErrorDetails struct {
	DeviceErrors ErrorDetails `json:device_errors,omitempty`
	AgentErrors  ErrorDetails `json:agent_errors,omitempty`
}

type CodeRevisionLong

type CodeRevisionLong struct {
	Version      int    `json:"version,omitempty"`
	CreatedAt    string `json:"created_at,omitempty"`
	DeviceCode   string `json:"device_code,omitempty"`
	AgentCode    string `json:"agent_code,omitempty"`
	ReleaseNotes string `json:"release_notes,omitempty"`
}

type CodeRevisionResponse

type CodeRevisionResponse struct {
	Success   bool             `json:"success"`
	Revisions CodeRevisionLong `json:"revision,omitempty"`
	Error     BuildError       `json:"error,omitempty"`
}

type CodeRevisionShort

type CodeRevisionShort struct {
	Version      int    `json:"version"`
	CreatedAt    string `json:"created_at"`
	ReleaseNotes string `json:"release_notes"`
}

type CodeRevisionsResponse

type CodeRevisionsResponse struct {
	Success   bool                `json:"success"`
	Revisions []CodeRevisionShort `json:"revisions"`
}

type Device

type Device struct {
	Id          string `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	ModelId     string `json:"model_id,omitempty"`
	PowerState  string `json:"powerstate,omitempty"`
	Rssi        int    `json:"rssi,omitempty"`
	AgentId     string `json:"agent_id,omitempty"`
	AgentStatus string `json:"agent_status,omitempty"`
}

type DeviceListResponse

type DeviceListResponse struct {
	Success bool     `json:"success"`
	Devices []Device `json:"devices"`
}

type DeviceLogEntry

type DeviceLogEntry struct {
	Timestamp string `json:"timestamp"`
	Type      string `json:"type"`
	Message   string `json:"message"`
}

type DeviceLogResponse

type DeviceLogResponse struct {
	Logs    []DeviceLogEntry `json:"logs"`
	PollUrl string           `json:"poll_url"`
	Success bool             `json:"success"`
}

type DeviceResponse

type DeviceResponse struct {
	Success bool   `json:"success"`
	Device  Device `json:"device"`
}

type ErrorDetails

type ErrorDetails struct {
	Row    int    `json:"row"`
	Column int    `json:"column"`
	Error  string `json:"error"`
}

type Model

type Model struct {
	Id      string   `json:"id,omitempty"`
	Name    string   `json:"name"`
	Devices []string `json:"devices,omitempty"`
}

type ModelError

type ModelError struct {
	Code         string `json:"code"`
	MessageShort string `json:"message_short"`
	MessageFull  string `json:"message_full"`
}

type ModelList

type ModelList struct {
	Models []Model `json:"models"`
}

type ModelResponse

type ModelResponse struct {
	Model   Model      `json:"model"`
	Success bool       `json:"success"`
	Error   ModelError `json:"error,omitempty"`
}

type Timeout

type Timeout struct {
}

func (Timeout) Error

func (m Timeout) Error() string

Jump to

Keyboard shortcuts

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