Documentation
¶
Overview ¶
A golang library for interfacing with Databox APIs.
Install using go get github.com/me-box/lib-go-databox
Examples can be found in the samples directory
Index ¶
- func ExportLongpoll(destination string, payload string) (string, error)
- func GetDsIdFromDsHref(href string) (string, error)
- func GetHttpsCredentials() string
- func GetStoreURLFromDsHref(href string) (string, error)
- func JsonUnmarshal(s string) (map[string]interface{}, error)
- func RegisterDatasource(href string, metadata StoreMetadata) (string, error)
- func StoreJSONGetlatest(href string) (string, error)
- func StoreJSONGetrange(href string, startTimestamp float64, endTimestamp float64) (string, error)
- func StoreJSONGetsince(href string, startTimestamp float64) (string, error)
- func StoreJSONWriteKV(href string, data string) error
- func StoreJSONWriteTS(href string, data string) error
- func StoreJSONreadKV(href string, key string) (string, error)
- func StoreTsLast(href string, n int) (string, error)
- func StoreTsLastNrange(href string, n int, startTimestamp int, endTimestamp int) (string, error)
- func StoreTsLastNsince(href string, n int, startTimestamp int) (string, error)
- func StoreTsLatest(href string) (string, error)
- func StoreTsRange(href string, startTimestamp int, endTimestamp int) (string, error)
- func StoreTsSince(href string, startTimestamp int) (string, error)
- func StoreTsWrite(href string, data string) (string, error)
- func WSConnect(href string) (chan []byte, error)
- func WSSubscribe(href string, storeType string) (string, error)
- func WSUnsubscribe(href string, storeType string) (string, error)
- func WaitForStoreStatus(href string)
- type StoreMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDsIdFromDsHref ¶
GetDsIdFromDsHref extracts the base data source ID from the href provied in the DATASOURCE_[name] environment variable.
func GetHttpsCredentials ¶
func GetHttpsCredentials() string
GetHttpsCredentials Returns a string containing the HTTPS credentials to pass to https server when offering an https server. These are read form /run/secrets/DATABOX.pem and are generated by the container-manger at run time.
func GetStoreURLFromDsHref ¶
GetStoreURLFromDsHref extracts the base store url from the href provied in the DATASOURCE_[name] environment variable.
func JsonUnmarshal ¶
JsonUnmarshal is a helper function to translate JSON stringified environment variable to go map[string]
func RegisterDatasource ¶
func RegisterDatasource(href string, metadata StoreMetadata) (string, error)
RegisterDatasource is used by apps and drivers to register datasource in stores they own.
func StoreJSONGetlatest ¶
func StoreJSONGetrange ¶
func StoreJSONGetsince ¶
func StoreJSONWriteKV ¶
func StoreJSONWriteTS ¶
func StoreTsLastNrange ¶
func StoreTsLastNsince ¶
func StoreTsLatest ¶
func StoreTsRange ¶
func WSConnect ¶
WSConnect connects to a target store's notification service
Returns a chan []byte that recives data from every route the connecting container is subscribed to. Data is a JSON string.
func WSSubscribe ¶
WSSubscribe Subscribes the caller to write notifications for a given route.
func WSUnsubscribe ¶
WSUnsubscribe Unsubscribes the caller to write notifications for a given route
func WaitForStoreStatus ¶
func WaitForStoreStatus(href string)
WaitForStoreStatus will wait for the store available at href to respond with an active status.