Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuthTokenTransport ¶
func NewAuthTokenTransport(t http.RoundTripper, token string) http.RoundTripper
Types ¶
type AuthTokenTransport ¶
type AuthTokenTransport struct {
// contains filtered or unexported fields
}
type Client ¶
type Client struct { // Services used for talking to different parts of the Enapter API. Commands CommandsAPI // 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 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.