Documentation ¶
Index ¶
- func NewAuthTokenTransport(t http.RoundTripper, token string) http.RoundTripper
- func NewAuthUserTransport(t http.RoundTripper, user string) http.RoundTripper
- type AssetsAPI
- type AuthTokenTransport
- type AuthUserTransport
- type BlueprintsAPI
- type Client
- type CommandProgress
- type CommandQuery
- type CommandResponse
- type CommandState
- type CommandsAPI
- type Device
- type DeviceByIDQuery
- type DeviceByIDResponse
- type DeviceConnectivity
- type DeviceType
- type DevicesQuery
- type DevicesResponse
- type Error
- type ExpandDeviceParams
- type ResponseError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuthTokenTransport ¶
func NewAuthTokenTransport(t http.RoundTripper, token string) http.RoundTripper
func NewAuthUserTransport ¶
func NewAuthUserTransport(t http.RoundTripper, user string) http.RoundTripper
Types ¶
type AssetsAPI ¶ added in v0.0.6
type AssetsAPI struct {
// contains filtered or unexported fields
}
func (*AssetsAPI) DeviceByID ¶ added in v0.0.8
func (a *AssetsAPI) DeviceByID( ctx context.Context, query DeviceByIDQuery, ) (DeviceByIDResponse, error)
func (*AssetsAPI) Devices ¶ added in v0.0.6
func (a *AssetsAPI) Devices( ctx context.Context, query DevicesQuery, ) (DevicesResponse, error)
type AuthTokenTransport ¶
type AuthTokenTransport struct {
// contains filtered or unexported fields
}
type AuthUserTransport ¶
type AuthUserTransport struct {
// contains filtered or unexported fields
}
type BlueprintsAPI ¶ added in v0.0.4
type BlueprintsAPI struct {
// contains filtered or unexported fields
}
type Client ¶
type Client struct { // Services used for talking to different parts of the Enapter API. Commands CommandsAPI Blueprints BlueprintsAPI Assets AssetsAPI // contains filtered or unexported fields }
func NewClientWithURL ¶
func (*Client) NewRequest ¶
type CommandProgress ¶
type CommandProgress struct { CommandResponse Error error }
type CommandQuery ¶
type CommandResponse ¶
type CommandResponse struct { State CommandState `json:"state"` Payload map[string]interface{} `json:"payload,omitempty"` }
type CommandState ¶
type CommandState string
const ( CommandSucceeded CommandState = "succeeded" CommandError CommandState = "error" CommandPlatformError CommandState = "platform_error" CommandStarted CommandState = "started" CommandInProgress CommandState = "device_in_progress" )
type CommandsAPI ¶
type CommandsAPI struct {
// contains filtered or unexported fields
}
func (*CommandsAPI) Execute ¶
func (c *CommandsAPI) Execute( ctx context.Context, query CommandQuery, ) (CommandResponse, error)
func (*CommandsAPI) ExecuteWithProgress ¶
func (c *CommandsAPI) ExecuteWithProgress( ctx context.Context, query CommandQuery, ) (<-chan CommandProgress, error)
type Device ¶ added in v0.0.6
type Device struct { DeviceID string `json:"device_id"` Type DeviceType `json:"type"` UpdatedAt time.Time `json:"updated_at"` Properties map[string]interface{} `json:"properties,omitempty"` Connectivity *DeviceConnectivity `json:"connectivity,omitempty"` Manifest json.RawMessage `json:"manifest,omitempty"` }
type DeviceByIDQuery ¶ added in v0.0.8
type DeviceByIDQuery struct { ID string Expand ExpandDeviceParams }
type DeviceByIDResponse ¶ added in v0.0.8
type DeviceConnectivity ¶ added in v0.0.6
type DeviceConnectivity struct {
Online bool `json:"online"`
}
type DeviceType ¶ added in v0.0.6
type DeviceType string
const ( DeviceTypeEndpoint DeviceType = "endpoint" DeviceTypeUCM DeviceType = "ucm" DeviceTypeGateway DeviceType = "gateway" )
type DevicesQuery ¶ added in v0.0.6
type DevicesQuery struct { PageToken string PageSize int FilterTypeIn []DeviceType Expand ExpandDeviceParams }
type DevicesResponse ¶ added in v0.0.6
type ExpandDeviceParams ¶ added in v0.0.8
type ResponseError ¶
type ResponseError struct { Errors []Error `json:"errors"` StatusCode int `json:"-"` RetryAfter time.Duration `json:"-"` }
func (ResponseError) Error ¶
func (r ResponseError) Error() string
Click to show internal directories.
Click to hide internal directories.