# README
lib-go-databox
A Golang library for interfacing with Databox APIs.
see https://godoc.org/github.com/me-box/lib-go-databox for full documtatiosn
Example
Set up the store and arbiter using setupTest.sh script
package main
import (
"fmt"
libDatabox "github.com/me-box/lib-go-databox"
)
func main () {
//Create a new client in testing mode outside databox
const testArbiterEndpoint = "tcp://127.0.0.1:4444"
const testStoreEndpoint = "tcp://127.0.0.1:5555"
ac, _ := libDatabox.NewArbiterClient("./", "./", testArbiterEndpoint)
storeClient := libDatabox.NewCoreStoreClient(ac, "./", DataboxStoreEndpoint, false)
//write some data
jsonData := `{"data":"This is a test"}`
err := storeClient.TSBlobJSON.Write("testdata1", []byte(jsonData))
if err != nil {
libDatabox.Err("Error Write Datasource " + err.Error())
}
//Read some data
jsonData, err := storeClient.TSBlobJSON.Latest("testdata1")
if err != nil {
libDatabox.Err("Error Write Datasource " + err.Error())
}
fmt.Println(jsonData)
}
More examples can be found in the databox-quickstart guide
Development of databox was supported by the following funding
EP/N028260/1, Databox: Privacy-Aware Infrastructure for Managing Personal Data
EP/N028260/2, Databox: Privacy-Aware Infrastructure for Managing Personal Data
EP/N014243/1, Future Everyday Interaction with the Autonomous Internet of Things
EP/M001636/1, Privacy-by-Design: Building Accountability into the Internet of Things EP/M02315X/1, From Human Data to Personal Experience
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
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.
GetStoreURLFromDsHref extracts the base store url from the href provied in the hypercat descriptions.
HypercatToDataSourceMetadata is a helper function to convert the hypercat description of a datasource to a DataSourceMetadata instance Also returns the store url for this data source.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewArbiterClient returns an arbiter client for use by components that require conunication with the arbiter.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
Allowed values for FilterType and AggregationFunction.
No description provided by the author
No description provided by the author
No description provided by the author
Allowed values for FilterType and AggregationFunction.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
DefaultHTTPSCertPath is the defaut loaction where apps and drivers can find the https certivicats needed to offer a secure UI.
DefaultHTTPSRootCertPath contins the Public key of this databoxes Root certificate needed to verify requests to other components (used in ).
No description provided by the author
Allowed values for FilterType and AggregationFunction.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Allowed values for FilterType and AggregationFunction.
Allowed values for FilterType and AggregationFunction.
Allowed values for FilterType and AggregationFunction.
Allowed values for FilterType and AggregationFunction.
Allowed values for FilterType and AggregationFunction.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Allowed values for FilterType and AggregationFunction.
# Structs
No description provided by the author
ContainerManagerOptions is used to configure the Container Manager.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Filter types to hold the required data to apply the filtering functions of the structured json API.
Func the databox function call, drivers can regiter functions with the Register method.
FuncRequest holds the datareturned from a function call.
FuncResponse describes the response that must be returned by a FuncHandler.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
OBSERVE RESPONSE
.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TimeSeriesQueryOptions describes the query options for the structured json API.
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
FuncHandler s are executed when a request is received on the request endpoint of registered functions.
FuncStatus is an int representing the status of a returned function.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author