Documentation ¶
Index ¶
- type Client
- type GetDeviceFuture
- type GetDeviceRequest
- type GetDeviceResponse
- type InfraredService
- type MockClient
- type UpdateDeviceFuture
- type UpdateDeviceRequest
- func (m *UpdateDeviceRequest) GetDeviceId() (val string)
- func (m *UpdateDeviceRequest) GetState() (val map[string]interface{}, set bool)
- func (m *UpdateDeviceRequest) SetDeviceId(v string) *UpdateDeviceRequest
- func (m *UpdateDeviceRequest) SetState(v map[string]interface{}) *UpdateDeviceRequest
- func (m *UpdateDeviceRequest) Validate() error
- type UpdateDeviceResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client makes requests to this service
func (*Client) GetDevice ¶
func (c *Client) GetDevice(ctx context.Context, body *GetDeviceRequest) *GetDeviceFuture
GetDevice dispatches an RPC to the service
func (*Client) UpdateDevice ¶
func (c *Client) UpdateDevice(ctx context.Context, body *UpdateDeviceRequest) *UpdateDeviceFuture
UpdateDevice dispatches an RPC to the service
type GetDeviceFuture ¶
type GetDeviceFuture struct {
// contains filtered or unexported fields
}
GetDeviceFuture represents an in-flight GetDevice request
func (*GetDeviceFuture) Wait ¶
func (f *GetDeviceFuture) Wait() (*GetDeviceResponse, error)
Wait blocks until the response is ready
type GetDeviceRequest ¶
type GetDeviceRequest struct {
DeviceId *string `json:"device_id,omitempty"`
}
GetDeviceRequest is defined in the .def file
func (*GetDeviceRequest) GetDeviceId ¶
func (m *GetDeviceRequest) GetDeviceId() (val string)
GetDeviceId returns the de-referenced value of DeviceId. If the field is nil, the function panics because device_id is marked as required.
func (*GetDeviceRequest) SetDeviceId ¶
func (m *GetDeviceRequest) SetDeviceId(v string) *GetDeviceRequest
SetDeviceId sets the value of DeviceId
func (*GetDeviceRequest) Validate ¶
func (m *GetDeviceRequest) Validate() error
Validate returns an error if any of the fields have bad values
type GetDeviceResponse ¶
type GetDeviceResponse struct { }
GetDeviceResponse is defined in the .def file
func (*GetDeviceResponse) Validate ¶
func (m *GetDeviceResponse) Validate() error
Validate returns an error if any of the fields have bad values
type InfraredService ¶
type InfraredService interface { GetDevice(ctx context.Context, body *GetDeviceRequest) *GetDeviceFuture UpdateDevice(ctx context.Context, body *UpdateDeviceRequest) *UpdateDeviceFuture }
InfraredService is the public interface of this service
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
MockClient can be used in tests
func NewMockClient ¶
func NewMockClient(ctx context.Context, t *testing.T) *MockClient
NewMockClient returns a new mock client
func (*MockClient) GetDevice ¶
func (c *MockClient) GetDevice(ctx context.Context, body *GetDeviceRequest) *GetDeviceFuture
GetDevice dispatches an RPC to the mock client
func (*MockClient) UpdateDevice ¶
func (c *MockClient) UpdateDevice(ctx context.Context, body *UpdateDeviceRequest) *UpdateDeviceFuture
UpdateDevice dispatches an RPC to the mock client
type UpdateDeviceFuture ¶
type UpdateDeviceFuture struct {
// contains filtered or unexported fields
}
UpdateDeviceFuture represents an in-flight UpdateDevice request
func (*UpdateDeviceFuture) Wait ¶
func (f *UpdateDeviceFuture) Wait() (*UpdateDeviceResponse, error)
Wait blocks until the response is ready
type UpdateDeviceRequest ¶
type UpdateDeviceRequest struct { DeviceId *string `json:"device_id,omitempty"` State map[string]interface{} `json:"state,omitempty"` }
UpdateDeviceRequest is defined in the .def file
func (*UpdateDeviceRequest) GetDeviceId ¶
func (m *UpdateDeviceRequest) GetDeviceId() (val string)
GetDeviceId returns the de-referenced value of DeviceId. If the field is nil, the function panics because device_id is marked as required.
func (*UpdateDeviceRequest) GetState ¶
func (m *UpdateDeviceRequest) GetState() (val map[string]interface{}, set bool)
GetState returns the de-referenced value of State. The second return value states whether the field was set.
func (*UpdateDeviceRequest) SetDeviceId ¶
func (m *UpdateDeviceRequest) SetDeviceId(v string) *UpdateDeviceRequest
SetDeviceId sets the value of DeviceId
func (*UpdateDeviceRequest) SetState ¶
func (m *UpdateDeviceRequest) SetState(v map[string]interface{}) *UpdateDeviceRequest
SetState sets the value of State
func (*UpdateDeviceRequest) Validate ¶
func (m *UpdateDeviceRequest) Validate() error
Validate returns an error if any of the fields have bad values
type UpdateDeviceResponse ¶
type UpdateDeviceResponse struct { }
UpdateDeviceResponse is defined in the .def file
func (*UpdateDeviceResponse) Validate ¶
func (m *UpdateDeviceResponse) Validate() error
Validate returns an error if any of the fields have bad values