deviceregistrydef

package
v0.0.0-...-eb599cc Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceHeader

type DeviceHeader struct {
	Id             string                 `json:"id"`
	Name           string                 `json:"name"`
	Type           string                 `json:"type"`
	Kind           string                 `json:"kind"`
	ControllerName string                 `json:"controller_name"`
	Attributes     map[string]interface{} `json:"attributes"`
	StateProviders []string               `json:"state_providers"`
	RoomId         string                 `json:"room_id"`
	Room           *Room                  `json:"room"`
}

DeviceHeader is defined in the .def file

func (*DeviceHeader) Validate

func (m *DeviceHeader) Validate() error

Validate returns an error if any of the fields have bad values

type DeviceRegistryClient

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

DeviceRegistryClient makes requests to this service

func NewDeviceRegistryClient

func NewDeviceRegistryClient(d taxi.Dispatcher) *DeviceRegistryClient

NewDeviceRegistryClient returns a new client

func (*DeviceRegistryClient) GetDevice

GetDevice dispatches an RPC to the service

func (*DeviceRegistryClient) GetRoom

GetRoom dispatches an RPC to the service

func (*DeviceRegistryClient) ListDevices

ListDevices dispatches an RPC to the service

func (*DeviceRegistryClient) ListRooms

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"`
}

GetDeviceRequest is defined in the .def file

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 {
	DeviceHeader *DeviceHeader `json:"device_header"`
}

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 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"`
}

GetRoomRequest is defined in the .def file

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"`
}

GetRoomResponse is defined in the .def file

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

Wait blocks until the response is ready

type ListDevicesRequest

type ListDevicesRequest struct {
	ControllerName string `json:"controller_name"`
}

ListDevicesRequest is defined in the .def file

func (*ListDevicesRequest) Validate

func (m *ListDevicesRequest) Validate() error

Validate returns an error if any of the fields have bad values

type ListDevicesResponse

type ListDevicesResponse struct {
	DeviceHeaders []*DeviceHeader `json:"device_headers"`
}

ListDevicesResponse is defined in the .def file

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"`
}

ListRoomsResponse is defined in the .def file

func (*ListRoomsResponse) Validate

func (m *ListRoomsResponse) Validate() error

Validate returns an error if any of the fields have bad values

type MockDeviceRegistryClient

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

MockDeviceRegistryClient can be used in tests

func NewMockDeviceRegistryClient

func NewMockDeviceRegistryClient(ctx context.Context, t *testing.T) *MockDeviceRegistryClient

NewMockDeviceRegistryClient returns a new mock client

func (*MockDeviceRegistryClient) GetDevice

GetDevice dispatches an RPC to the mock client

func (*MockDeviceRegistryClient) GetRoom

GetRoom dispatches an RPC to the mock client

func (*MockDeviceRegistryClient) ListDevices

ListDevices dispatches an RPC to the mock client

func (*MockDeviceRegistryClient) ListRooms

ListRooms dispatches an RPC to the mock client

type Room

type Room struct {
	Id      string          `json:"id"`
	Name    string          `json:"name"`
	Devices []*DeviceHeader `json:"devices"`
}

Room is defined in the .def file

func (*Room) Validate

func (m *Room) Validate() error

Validate returns an error if any of the fields have bad values

Jump to

Keyboard shortcuts

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