Documentation ¶
Index ¶
- type Action
- type CreateSceneFuture
- type CreateSceneRequest
- type CreateSceneRequest_Action
- type CreateSceneResponse
- type DeleteSceneFuture
- type DeleteSceneRequest
- type DeleteSceneResponse
- type ListScenesFuture
- type ListScenesRequest
- type ListScenesResponse
- type MockSceneClient
- func (c *MockSceneClient) CreateScene(ctx context.Context, body *CreateSceneRequest) *CreateSceneFuture
- func (c *MockSceneClient) DeleteScene(ctx context.Context, body *DeleteSceneRequest) *DeleteSceneFuture
- func (c *MockSceneClient) ListScenes(ctx context.Context, body *ListScenesRequest) *ListScenesFuture
- func (c *MockSceneClient) ReadScene(ctx context.Context, body *ReadSceneRequest) *ReadSceneFuture
- func (c *MockSceneClient) SetScene(ctx context.Context, body *SetSceneRequest) *SetSceneFuture
- type ReadSceneFuture
- type ReadSceneRequest
- type ReadSceneResponse
- type Scene
- type SceneClient
- func (c *SceneClient) CreateScene(ctx context.Context, body *CreateSceneRequest) *CreateSceneFuture
- func (c *SceneClient) DeleteScene(ctx context.Context, body *DeleteSceneRequest) *DeleteSceneFuture
- func (c *SceneClient) ListScenes(ctx context.Context, body *ListScenesRequest) *ListScenesFuture
- func (c *SceneClient) ReadScene(ctx context.Context, body *ReadSceneRequest) *ReadSceneFuture
- func (c *SceneClient) SetScene(ctx context.Context, body *SetSceneRequest) *SetSceneFuture
- type SceneService
- type SetSceneEvent
- type SetSceneEventHandler
- type SetSceneFuture
- type SetSceneRequest
- type SetSceneResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { Stage int32 `json:"stage"` Sequence int32 `json:"sequence"` Func string `json:"func"` ControllerName string `json:"controller_name"` DeviceId string `json:"device_id"` Command string `json:"command"` Property string `json:"property"` PropertyValue string `json:"property_value"` PropertyType string `json:"property_type"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Action is defined in the .def file
type CreateSceneFuture ¶
type CreateSceneFuture struct {
// contains filtered or unexported fields
}
CreateSceneFuture represents an in-flight CreateScene request
func (*CreateSceneFuture) Wait ¶
func (f *CreateSceneFuture) Wait() (*CreateSceneResponse, error)
Wait blocks until the response is ready
type CreateSceneRequest ¶
type CreateSceneRequest struct { Name string `json:"name"` OwnerId uint32 `json:"owner_id"` Actions []*CreateSceneRequest_Action `json:"actions"` }
CreateSceneRequest is defined in the .def file
func (*CreateSceneRequest) Validate ¶
func (m *CreateSceneRequest) Validate() error
Validate returns an error if any of the fields have bad values
type CreateSceneRequest_Action ¶
type CreateSceneRequest_Action struct { Stage int32 `json:"stage"` Sequence int32 `json:"sequence"` Func string `json:"func"` ControllerName string `json:"controller_name"` DeviceId string `json:"device_id"` Command string `json:"command"` Property string `json:"property"` PropertyValue string `json:"property_value"` PropertyType string `json:"property_type"` }
CreateSceneRequest_Action is defined in the .def file
func (*CreateSceneRequest_Action) Validate ¶
func (m *CreateSceneRequest_Action) Validate() error
Validate returns an error if any of the fields have bad values
type CreateSceneResponse ¶
type CreateSceneResponse struct {
Scene *Scene `json:"scene"`
}
CreateSceneResponse is defined in the .def file
func (*CreateSceneResponse) Validate ¶
func (m *CreateSceneResponse) Validate() error
Validate returns an error if any of the fields have bad values
type DeleteSceneFuture ¶
type DeleteSceneFuture struct {
// contains filtered or unexported fields
}
DeleteSceneFuture represents an in-flight DeleteScene request
func (*DeleteSceneFuture) Wait ¶
func (f *DeleteSceneFuture) Wait() (*DeleteSceneResponse, error)
Wait blocks until the response is ready
type DeleteSceneRequest ¶
type DeleteSceneRequest struct {
SceneId int32 `json:"scene_id"`
}
DeleteSceneRequest is defined in the .def file
func (*DeleteSceneRequest) Validate ¶
func (m *DeleteSceneRequest) Validate() error
Validate returns an error if any of the fields have bad values
type DeleteSceneResponse ¶
type DeleteSceneResponse struct { }
DeleteSceneResponse is defined in the .def file
func (*DeleteSceneResponse) Validate ¶
func (m *DeleteSceneResponse) Validate() error
Validate returns an error if any of the fields have bad values
type ListScenesFuture ¶
type ListScenesFuture struct {
// contains filtered or unexported fields
}
ListScenesFuture represents an in-flight ListScenes request
func (*ListScenesFuture) Wait ¶
func (f *ListScenesFuture) Wait() (*ListScenesResponse, error)
Wait blocks until the response is ready
type ListScenesRequest ¶
type ListScenesRequest struct {
OwnerId uint32 `json:"owner_id"`
}
ListScenesRequest is defined in the .def file
func (*ListScenesRequest) Validate ¶
func (m *ListScenesRequest) Validate() error
Validate returns an error if any of the fields have bad values
type ListScenesResponse ¶
type ListScenesResponse struct {
Scenes []*Scene `json:"scenes"`
}
ListScenesResponse is defined in the .def file
func (*ListScenesResponse) Validate ¶
func (m *ListScenesResponse) Validate() error
Validate returns an error if any of the fields have bad values
type MockSceneClient ¶
type MockSceneClient struct {
// contains filtered or unexported fields
}
MockSceneClient can be used in tests
func NewMockSceneClient ¶
func NewMockSceneClient(ctx context.Context, t *testing.T) *MockSceneClient
NewMockSceneClient returns a new mock client
func (*MockSceneClient) CreateScene ¶
func (c *MockSceneClient) CreateScene(ctx context.Context, body *CreateSceneRequest) *CreateSceneFuture
CreateScene dispatches an RPC to the mock client
func (*MockSceneClient) DeleteScene ¶
func (c *MockSceneClient) DeleteScene(ctx context.Context, body *DeleteSceneRequest) *DeleteSceneFuture
DeleteScene dispatches an RPC to the mock client
func (*MockSceneClient) ListScenes ¶
func (c *MockSceneClient) ListScenes(ctx context.Context, body *ListScenesRequest) *ListScenesFuture
ListScenes dispatches an RPC to the mock client
func (*MockSceneClient) ReadScene ¶
func (c *MockSceneClient) ReadScene(ctx context.Context, body *ReadSceneRequest) *ReadSceneFuture
ReadScene dispatches an RPC to the mock client
func (*MockSceneClient) SetScene ¶
func (c *MockSceneClient) SetScene(ctx context.Context, body *SetSceneRequest) *SetSceneFuture
SetScene dispatches an RPC to the mock client
type ReadSceneFuture ¶
type ReadSceneFuture struct {
// contains filtered or unexported fields
}
ReadSceneFuture represents an in-flight ReadScene request
func (*ReadSceneFuture) Wait ¶
func (f *ReadSceneFuture) Wait() (*ReadSceneResponse, error)
Wait blocks until the response is ready
type ReadSceneRequest ¶
type ReadSceneRequest struct {
SceneId uint32 `json:"scene_id"`
}
ReadSceneRequest is defined in the .def file
func (*ReadSceneRequest) Validate ¶
func (m *ReadSceneRequest) Validate() error
Validate returns an error if any of the fields have bad values
type ReadSceneResponse ¶
type ReadSceneResponse struct {
Scene *Scene `json:"scene"`
}
ReadSceneResponse is defined in the .def file
func (*ReadSceneResponse) Validate ¶
func (m *ReadSceneResponse) Validate() error
Validate returns an error if any of the fields have bad values
type Scene ¶
type Scene struct { Id uint32 `json:"id"` Name string `json:"name"` OwnerId uint32 `json:"owner_id"` Actions []*Action `json:"actions"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Scene is defined in the .def file
type SceneClient ¶
type SceneClient struct {
// contains filtered or unexported fields
}
SceneClient makes requests to this service
func NewSceneClient ¶
func NewSceneClient(d taxi.Dispatcher) *SceneClient
NewSceneClient returns a new client
func (*SceneClient) CreateScene ¶
func (c *SceneClient) CreateScene(ctx context.Context, body *CreateSceneRequest) *CreateSceneFuture
CreateScene dispatches an RPC to the service
func (*SceneClient) DeleteScene ¶
func (c *SceneClient) DeleteScene(ctx context.Context, body *DeleteSceneRequest) *DeleteSceneFuture
DeleteScene dispatches an RPC to the service
func (*SceneClient) ListScenes ¶
func (c *SceneClient) ListScenes(ctx context.Context, body *ListScenesRequest) *ListScenesFuture
ListScenes dispatches an RPC to the service
func (*SceneClient) ReadScene ¶
func (c *SceneClient) ReadScene(ctx context.Context, body *ReadSceneRequest) *ReadSceneFuture
ReadScene dispatches an RPC to the service
func (*SceneClient) SetScene ¶
func (c *SceneClient) SetScene(ctx context.Context, body *SetSceneRequest) *SetSceneFuture
SetScene dispatches an RPC to the service
type SceneService ¶
type SceneService interface { CreateScene(ctx context.Context, body *CreateSceneRequest) *CreateSceneFuture ReadScene(ctx context.Context, body *ReadSceneRequest) *ReadSceneFuture ListScenes(ctx context.Context, body *ListScenesRequest) *ListScenesFuture DeleteScene(ctx context.Context, body *DeleteSceneRequest) *DeleteSceneFuture SetScene(ctx context.Context, body *SetSceneRequest) *SetSceneFuture }
SceneService is the public interface of this service
type SetSceneEvent ¶
type SetSceneEvent struct {
SceneId uint32 `json:"scene_id"`
}
SetSceneEvent is defined in the .def file
func (*SetSceneEvent) Publish ¶
func (m *SetSceneEvent) Publish() error
Publish publishes the event to the Firehose
func (*SetSceneEvent) Validate ¶
func (m *SetSceneEvent) Validate() error
Validate returns an error if any of the fields have bad values
type SetSceneEventHandler ¶
type SetSceneEventHandler func(*SetSceneEvent) firehose.Result
SetSceneEventHandler implements the necessary functions to be a Firehose handler
func (SetSceneEventHandler) EventName ¶
func (h SetSceneEventHandler) EventName() string
EventName returns the Firehose channel name
func (SetSceneEventHandler) HandleEvent ¶
func (h SetSceneEventHandler) HandleEvent(e *firehose.Event) firehose.Result
HandleEvent handles the Firehose event
type SetSceneFuture ¶
type SetSceneFuture struct {
// contains filtered or unexported fields
}
SetSceneFuture represents an in-flight SetScene request
func (*SetSceneFuture) Wait ¶
func (f *SetSceneFuture) Wait() (*SetSceneResponse, error)
Wait blocks until the response is ready
type SetSceneRequest ¶
type SetSceneRequest struct {
SceneId uint32 `json:"scene_id"`
}
SetSceneRequest is defined in the .def file
func (*SetSceneRequest) Validate ¶
func (m *SetSceneRequest) Validate() error
Validate returns an error if any of the fields have bad values
type SetSceneResponse ¶
type SetSceneResponse struct { }
SetSceneResponse is defined in the .def file
func (*SetSceneResponse) Validate ¶
func (m *SetSceneResponse) Validate() error
Validate returns an error if any of the fields have bad values