Documentation ¶
Overview ¶
Package casa defines interfaces and types for the casa home automation platform. These interfaces are subject to change without notice as casa is refined. Feel free to play with it now but wait until a v1 release before you depend on it for anything.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger interface {
Log(a ...interface{})
}
Logger represents a way to log error messages for the user.
type MessageBus ¶
type MessageBus interface { // Shutdown the MessageBus Close() error // NewClient returns a client that is connected to the MessageBus NewClient() MessageClient }
MessageBus defines a system for passing Messages
type MessageClient ¶
type MessageClient interface { // Register a function to call when a message or error is received Handle(func(msg *Message, err error)) // Publish a pre-composed message PublishMessage(message Message) error // Subscribes to the given topic Subscribe(topic string) error // Removes subscription for the topic Unsubscribe(topic string) error // Closes the client Close() error }
MessageClient sends and receives Messages to a MessageBus
type Service ¶
type Service interface { // Start the service. Config is the config section for that service, // with the global MQTT config section appended. Start(config *viper.Viper) error // Specifies the logger to be used. UseLogger(logger Logger) // Stops the service. Stop() error }
Service defines a type that can subscribe to the message bus and perform actions.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
casa/environment
The environment package provides a way to setup a global environment and also have the ability to create local encironments for testing.
|
The environment package provides a way to setup a global environment and also have the ability to create local encironments for testing. |
Click to show internal directories.
Click to hide internal directories.