SDKs
Go
Installing
The SDK is available on Github, so available via the standard go get
Basic Usage
Importing
The sailhouse
package has all the goodness in it.
Initialising the Client
The package has a SailhouseClient
struct which holds all the methods for interacting with the Sailhouse platform.
Provided you have generated a token, you can create a client easily with sailhouse.NewSailhouseClient(...)
Sending an event
The client has a Publish(...)
method on it for easily sending data to a given topic
The data
arg must be able to be marshalled into JSON via json.Marshal
. If this fails, it will return an error, and the event will not be sent.
Receiving events from a pull subscription
The client also has a GetEvents(...)
method for requesting the events sent to a given subscription for a topic.