scenedef

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: 7 Imported by: 0

Documentation

Index

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

func (*Action) Validate

func (m *Action) Validate() error

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

type CreateSceneFuture

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

CreateSceneFuture represents an in-flight CreateScene request

func (*CreateSceneFuture) Wait

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

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

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

CreateScene dispatches an RPC to the mock client

func (*MockSceneClient) DeleteScene

DeleteScene dispatches an RPC to the mock client

func (*MockSceneClient) ListScenes

ListScenes dispatches an RPC to the mock client

func (*MockSceneClient) ReadScene

ReadScene dispatches an RPC to the mock client

func (*MockSceneClient) SetScene

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

func (*Scene) Validate

func (m *Scene) Validate() error

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

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

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

Jump to

Keyboard shortcuts

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