Documentation ¶
Index ¶
- type Client
- func (c *Client) GetDevice(ctx context.Context, body *GetDeviceRequest) *GetDeviceFuture
- func (c *Client) GetRoom(ctx context.Context, body *GetRoomRequest) *GetRoomFuture
- func (c *Client) ListDevices(ctx context.Context, body *ListDevicesRequest) *ListDevicesFuture
- func (c *Client) ListRooms(ctx context.Context, body *ListRoomsRequest) *ListRoomsFuture
- type DeviceRegistryService
- type GetDeviceFuture
- type GetDeviceRequest
- type GetDeviceResponse
- type GetRoomFuture
- type GetRoomRequest
- type GetRoomResponse
- type ListDevicesFuture
- type ListDevicesRequest
- type ListDevicesResponse
- type ListRoomsFuture
- type ListRoomsRequest
- type ListRoomsResponse
- type MockClient
- func (c *MockClient) GetDevice(ctx context.Context, body *GetDeviceRequest) *GetDeviceFuture
- func (c *MockClient) GetRoom(ctx context.Context, body *GetRoomRequest) *GetRoomFuture
- func (c *MockClient) ListDevices(ctx context.Context, body *ListDevicesRequest) *ListDevicesFuture
- func (c *MockClient) ListRooms(ctx context.Context, body *ListRoomsRequest) *ListRoomsFuture
- type Room
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) GetRoom ¶
func (c *Client) GetRoom(ctx context.Context, body *GetRoomRequest) *GetRoomFuture
GetRoom dispatches an RPC to the service
func (*Client) ListDevices ¶
func (c *Client) ListDevices(ctx context.Context, body *ListDevicesRequest) *ListDevicesFuture
ListDevices dispatches an RPC to the service
func (*Client) ListRooms ¶
func (c *Client) ListRooms(ctx context.Context, body *ListRoomsRequest) *ListRoomsFuture
ListRooms dispatches an RPC to the service
type DeviceRegistryService ¶
type DeviceRegistryService interface { GetDevice(ctx context.Context, body *GetDeviceRequest) *GetDeviceFuture ListDevices(ctx context.Context, body *ListDevicesRequest) *ListDevicesFuture GetRoom(ctx context.Context, body *GetRoomRequest) *GetRoomFuture ListRooms(ctx context.Context, body *ListRoomsRequest) *ListRoomsFuture }
DeviceRegistryService is the public interface of this 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 ¶
GetDeviceResponse is defined in the .def file
func (*GetDeviceResponse) GetDeviceHeader ¶
func (m *GetDeviceResponse) GetDeviceHeader() (val def.Header, set bool)
GetDeviceHeader returns the de-referenced value of DeviceHeader. The second return value states whether the field was set.
func (*GetDeviceResponse) SetDeviceHeader ¶
func (m *GetDeviceResponse) SetDeviceHeader(v def.Header) *GetDeviceResponse
SetDeviceHeader sets the value of DeviceHeader
func (*GetDeviceResponse) Validate ¶
func (m *GetDeviceResponse) Validate() error
Validate returns an error if any of the fields have bad values
type GetRoomFuture ¶
type GetRoomFuture struct {
// contains filtered or unexported fields
}
GetRoomFuture represents an in-flight GetRoom request
func (*GetRoomFuture) Wait ¶
func (f *GetRoomFuture) Wait() (*GetRoomResponse, error)
Wait blocks until the response is ready
type GetRoomRequest ¶
type GetRoomRequest struct {
RoomId *string `json:"room_id,omitempty"`
}
GetRoomRequest is defined in the .def file
func (*GetRoomRequest) GetRoomId ¶
func (m *GetRoomRequest) GetRoomId() (val string)
GetRoomId returns the de-referenced value of RoomId. If the field is nil, the function panics because room_id is marked as required.
func (*GetRoomRequest) SetRoomId ¶
func (m *GetRoomRequest) SetRoomId(v string) *GetRoomRequest
SetRoomId sets the value of RoomId
func (*GetRoomRequest) Validate ¶
func (m *GetRoomRequest) Validate() error
Validate returns an error if any of the fields have bad values
type GetRoomResponse ¶
type GetRoomResponse struct {
Room *Room `json:"room,omitempty"`
}
GetRoomResponse is defined in the .def file
func (*GetRoomResponse) GetRoom ¶
func (m *GetRoomResponse) GetRoom() (val Room, set bool)
GetRoom returns the de-referenced value of Room. The second return value states whether the field was set.
func (*GetRoomResponse) SetRoom ¶
func (m *GetRoomResponse) SetRoom(v Room) *GetRoomResponse
SetRoom sets the value of Room
func (*GetRoomResponse) Validate ¶
func (m *GetRoomResponse) Validate() error
Validate returns an error if any of the fields have bad values
type ListDevicesFuture ¶
type ListDevicesFuture struct {
// contains filtered or unexported fields
}
ListDevicesFuture represents an in-flight ListDevices request
func (*ListDevicesFuture) Wait ¶
func (f *ListDevicesFuture) Wait() (*ListDevicesResponse, error)
Wait blocks until the response is ready
type ListDevicesRequest ¶
type ListDevicesRequest struct {
ControllerName *string `json:"controller_name,omitempty"`
}
ListDevicesRequest is defined in the .def file
func (*ListDevicesRequest) GetControllerName ¶
func (m *ListDevicesRequest) GetControllerName() (val string, set bool)
GetControllerName returns the de-referenced value of ControllerName. The second return value states whether the field was set.
func (*ListDevicesRequest) SetControllerName ¶
func (m *ListDevicesRequest) SetControllerName(v string) *ListDevicesRequest
SetControllerName sets the value of ControllerName
func (*ListDevicesRequest) Validate ¶
func (m *ListDevicesRequest) Validate() error
Validate returns an error if any of the fields have bad values
type ListDevicesResponse ¶
ListDevicesResponse is defined in the .def file
func (*ListDevicesResponse) GetDeviceHeaders ¶
func (m *ListDevicesResponse) GetDeviceHeaders() (val []*def.Header, set bool)
GetDeviceHeaders returns the de-referenced value of DeviceHeaders. The second return value states whether the field was set.
func (*ListDevicesResponse) SetDeviceHeaders ¶
func (m *ListDevicesResponse) SetDeviceHeaders(v []*def.Header) *ListDevicesResponse
SetDeviceHeaders sets the value of DeviceHeaders
func (*ListDevicesResponse) Validate ¶
func (m *ListDevicesResponse) Validate() error
Validate returns an error if any of the fields have bad values
type ListRoomsFuture ¶
type ListRoomsFuture struct {
// contains filtered or unexported fields
}
ListRoomsFuture represents an in-flight ListRooms request
func (*ListRoomsFuture) Wait ¶
func (f *ListRoomsFuture) Wait() (*ListRoomsResponse, error)
Wait blocks until the response is ready
type ListRoomsRequest ¶
type ListRoomsRequest struct { }
ListRoomsRequest is defined in the .def file
func (*ListRoomsRequest) Validate ¶
func (m *ListRoomsRequest) Validate() error
Validate returns an error if any of the fields have bad values
type ListRoomsResponse ¶
type ListRoomsResponse struct {
Rooms []*Room `json:"rooms,omitempty"`
}
ListRoomsResponse is defined in the .def file
func (*ListRoomsResponse) GetRooms ¶
func (m *ListRoomsResponse) GetRooms() (val []*Room, set bool)
GetRooms returns the de-referenced value of Rooms. The second return value states whether the field was set.
func (*ListRoomsResponse) SetRooms ¶
func (m *ListRoomsResponse) SetRooms(v []*Room) *ListRoomsResponse
SetRooms sets the value of Rooms
func (*ListRoomsResponse) Validate ¶
func (m *ListRoomsResponse) Validate() error
Validate returns an error if any of the fields have bad values
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) GetRoom ¶
func (c *MockClient) GetRoom(ctx context.Context, body *GetRoomRequest) *GetRoomFuture
GetRoom dispatches an RPC to the mock client
func (*MockClient) ListDevices ¶
func (c *MockClient) ListDevices(ctx context.Context, body *ListDevicesRequest) *ListDevicesFuture
ListDevices dispatches an RPC to the mock client
func (*MockClient) ListRooms ¶
func (c *MockClient) ListRooms(ctx context.Context, body *ListRoomsRequest) *ListRoomsFuture
ListRooms dispatches an RPC to the mock client
type Room ¶
type Room struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` Devices []*def.Header `json:"devices,omitempty"` }
Room is defined in the .def file
func (*Room) GetDevices ¶
GetDevices returns the de-referenced value of Devices. The second return value states whether the field was set.
func (*Room) GetId ¶
GetId returns the de-referenced value of Id. If the field is nil, the function panics because id is marked as required.
func (*Room) GetName ¶
GetName returns the de-referenced value of Name. If the field is nil, the function panics because name is marked as required.
func (*Room) SetDevices ¶
SetDevices sets the value of Devices