Git Product home page Git Product logo

lib-go-databox's Introduction

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

lib-go-databox's People

Contributors

cgreenhalgh avatar toshbrown avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lib-go-databox's Issues

consistent semantics of store request APIs

in the node version, the response's status code of a store request is checked, all non-2XX codes are considered error and a rejected promise is returned to a client:
https://github.com/me-box/lib-node-databox/blob/master/lib/utils.js#L88

maybe worth doing the same for this two functions too:
https://github.com/me-box/lib-go-databox/blob/master/utils.go#L165
https://github.com/me-box/lib-go-databox/blob/master/utils.go#L200
to make the semantics consistent between these two libs

coreStoreClient.go observe function error

Hello. I have interests about PDS projects, so I tried to run databox project on my local machine.

During "make all" , I got error message as follows:

Step 11/16 : RUN make build
---> Running in 662f31c3f6d2
rm -rf //src/github.com/docker/docker/vendor/github.com/docker/go-connections > /dev/null
go build -ldflags="-s -w" -o bin/databox *.go
"# github.com/me-box/lib-go-databox"
src/github.com/me-box/lib-go-databox/coreStoreClient.go:188:42: not enough arguments in call to csc.ZestC.Observe
have (string, string, string, number)
want (string, string, string, zest.ObserveMode, uint32)
make: *** [Makefile:70: build] Error 2

I think either coreStoreClient or goZestClient should be fixed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.