infrareddef

package
v0.0.0-...-34c5bf1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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 NewClient

func NewClient(dispatcher taxi.Dispatcher) *Client

NewClient returns a new client

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

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

Jump to

Keyboard shortcuts

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