colonio

package module
v0.0.0-...-11e6f87 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

README

Colonio node library for golang

This project exports Colonio for golang.

How to test.

at workdir
$ git clone https://github.com/llamerada-jp/colonio-go.git
$ cd colonio-go
$ make test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Colonio

type Colonio interface {
	Connect(url, token string) error
	Disconnect() error
	AccessMap(name string) Map
	AccessPubsub2D(name string) Pubsub2D
	GetLocalNid() string
	SetPosition(x, y float64) (float64, float64, error)
	Quit() error
}

Colonio is an interface. It is equivalent to one node.

func NewColonio

func NewColonio() (Colonio, error)

NewColonio creates a new initialized instance.

type Map

type Map interface {
	Get(key interface{}) (Value, error)
	Set(key, val interface{}, opt uint32) error
}

type Pubsub2D

type Pubsub2D interface {
	Publish(name string, x, y, r float64, val interface{}, opt uint32) error
	On(name string, cb func(Value))
	Off(name string)
}

type Value

type Value interface {
	IsNil() bool
	IsBool() bool
	IsInt() bool
	IsDouble() bool
	IsString() bool
	Set(val interface{}) error
	GetBool() (bool, error)
	GetInt() (int64, error)
	GetDouble() (float64, error)
	GetString() (string, error)
}

Value is an instance, it is equivalent to one value.

func NewValue

func NewValue(v interface{}) (Value, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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