Categorygithub.com/eclipse-zenoh/zenoh-go
modulepackage
0.0.0-20201008085744-0f2c7665ef8d
Repository: https://github.com/eclipse-zenoh/zenoh-go.git
Documentation: pkg.go.dev

# README

zenoh banner

Build GoReport Status Documentation Status Gitter License License

Eclipse zenoh Go API

Eclipse zenoh is an extremely efficient and fault-tolerant Named Data Networking (NDN) protocol that is able to scale down to extremely constrainded devices and networks.

:warning: zenoh has been subjet to a complete rewrite with major protocol updates between versions 0.4.2 and 0.5.0. The Go API does not yet integrate those changes and is only compatible with version 0.4.2 of the zenoh daemon and the underlying zenoh-c stack.

The Go API is for pure clients, in other terms does not support peer-to-peer communication, can be easily tested against a zenoh router running in a Docker container (see https://github.com/eclipse-zenoh/zenoh#how-to-test-it).


How to install it

The zenoh-go library relies on the zenoh-c library. Please install it, either installing the libzenohc-dev package, either building zenoh-c by yourself

Supported Go version: 1.14.0 minimum.

Install the zenoh-go library via the usual go getcommand:

$ go get github.com/eclipse-zenoh/zenoh-go

Running the Examples

The simplest way to run some of the example is to get a Docker image of the zenoh network router (see https://github.com/eclipse-zenoh/zenoh#how-to-test-it) and then to run the examples on your machine.

Then, run the zenoh-go examples following the instructions in examples/zenoh/README.md

# Packages

No description provided by the author

# Functions

Login establishes a zenoh session via a provided locator.
NewFloatValue returns a new FloatValue.
NewIntValue returns a new IntValue.
NewPath returns a new Path from the string p, if it's a valid path specification.
NewPropertiesValue returns a new PropertiesValue.
NewRawValue returns a new RawValue.
NewSelector returns a new Selector from the string s, if it's a valid path specification.
NewStringValue returns a new StringValue.
RegisterValueDecoder registers a ValueDecoder function with it's Encoding.

# Constants

FLOAT The value is a float as an UTF-8 string.
INT The value is an integer as an UTF-8 string.
JSON The value is a JSON structure in an UTF-8 string.
PROPERTIES: The value if a list of keys/values, encoded as an UTF-8 string.
PropPassword is the "password" property key.
PropUser is the "user" property key.
PUT represents a change made by a put on Zenoh.
RAW: The value has a RAW encoding (i.e.
REMOVE represents a change made by a remove on Zenoh.
STRING: The value is an UTF-8 string.
UPDATE represents a change made by an update on Zenoh.

# Structs

Admin is the zenoh administration class.
Change represents the notification of a change for a resource in zenoh.
Data is a zenoh data returned by a Workspace.get(selector) query.
FloatValue is a FLOAT value (i.e.
IntValue is a INT value (i.e.
Path is a set of strings separated by '/' , as in a filesystem path.
PropertiesValue is a PROPERTIES value (i.e.
RawValue is a RAW value (i.e.
Selector is a string which is the conjunction of an path expression identifying a set of keys and some optional parts allowing to refine the set of Paths and associated Values.
StringValue is a STRING value (i.e.
Workspace allows to operate on Zenoh.
Zenoh is the Zenoh client API.

# Interfaces

Value is the interface of a value that, associated to a Path, can be published into zenoh via Workspace.put(Path, Value), or retrieved via Workspace.get(Selector) or via a subscription (Workspace.subscribe(Selector, Listener)).

# Type aliases

ChangeKind is a kind of change.
Encoding is a description of the Value format, allowing zenoh to know how to encode/decode the value to/from a bytes buffer.
Eval defines the callback function that has to be registered for evals.
Listener defines the callback function that has to be registered for subscriptions.
Properties is a (string,string) map.
SubscriptionID identifies a Zenoh subscription.
Timestamp is a Zenoh Timestamp.
ValueDecoder is a decoder for a Value.
ZError reports an error that occurred in zenoh.