zest

package module
v0.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2019 License: MIT Imports: 9 Imported by: 0

README

goZestClient

Build Status

A Golang Lib for REST over ZeroMQ

Starting server to test against

$ docker run -p 5555:5555 -p 5556:5556 -d --name zest --rm jptmoore/zest:v0.1.1 /app/zest/server.exe --secret-key-file example-server-key --enable-logging
$ docker logs zest -f

Client for testing

In the ./client directory there is a simple client for testing this library with the zest server. Run go run ./client.js to run with the default options.

Usage of client.go:
  -enable-logging
    	output debug information
  -format string
    	text, json, binary to set the message content type (default "JSON")
  -method string
    	set the mode of operation (default "OBSERVE")
  -path string
    	Set the uri path for POST and GET (default "/kv/foo")
  -payload string
    	Set the uri path for POST and GET (default "{\"name\":\"dave\", \"age\":30}")
  -request-endpoint string
    	set the request/reply endpoint (default "tcp://127.0.0.1:5555")
  -router-endpoint string
    	set the router/dealer endpoint (default "tcp://127.0.0.1:5556")
  -server-key string
    	Set the curve server key (default "vl6wu0A@XP?}Or/&BR#LSxn>A+}L)p44/W[wXL3<")
  -token string
    	Set set access token

Running unit tests

./test/test.sh

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 (IoTDatabox)

EP/M02315X/1, From Human Data to Personal Experience

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecvBytesOverChan added in v0.0.13

func RecvBytesOverChan(soc *zmq.Socket) (chan []byte, chan error)

Types

type ObserveMode added in v0.0.10

type ObserveMode string
const ObserveModeAudit ObserveMode = "audit"
const ObserveModeData ObserveMode = "data"
const ObserveModeNotification ObserveMode = "notification"

type ZestClient

type ZestClient struct {
	Endpoint       string
	DealerEndpoint string
	// contains filtered or unexported fields
}

func New

func New(endpoint string, dealerEndpoint string, serverKey string, enableLogging bool) (ZestClient, error)

New returns a ZestClient connected to endpoint using serverKey as an identity

func (ZestClient) Delete

func (z ZestClient) Delete(token string, path string, contentFormat string) error

func (ZestClient) Get

func (z ZestClient) Get(token string, path string, contentFormat string) ([]byte, error)

func (ZestClient) Hexlog

func (z ZestClient) Hexlog(msg []byte)

func (ZestClient) Notify added in v0.0.10

func (z ZestClient) Notify(token string, path string, contentFormat string, timeout uint32) (<-chan []byte, chan struct{}, error)

func (ZestClient) Observe

func (z ZestClient) Observe(token string, path string, contentFormat string, observeMode ObserveMode, timeout uint32) (<-chan []byte, chan struct{}, error)

func (ZestClient) Post

func (z ZestClient) Post(token string, path string, payload []byte, contentFormat string) ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL