Documentation ¶
Overview ¶
Package teoregistry (teo-registry) is the Teonet registry service package
Teoregistry store teonet applications(services) and its commands api description in teonet database. This package contain teonet registry database schemas, services and clients functions.
Install this go package:
go get github.com/kirill-scherba/teonet-go/services/teoregistry
Data base organisation ¶
To store database we use ScyllaDB. Run Scylla in Docker:
https://www.scylladb.com/download/open-source/#docker
Install database schemas. Before you execute application which used this service, launch `cqlsh`:
docker exec -it scylla cqlsh
and execute next commands:
// Keyspace 'teoregistry' CREATE KEYSPACE teoregistry WITH replication = { 'class': 'SimpleStrategy', 'replication_factor' : 3 }; USE teoregistry; // Table 'applications': Teonet applications (services) description CREATE TABLE IF NOT EXISTS applications( uuid TIMEUUID, name TEXT, version TEXT, descr TEXT, author TEXT, license TEXT, goget TEXT, git TEXT, PRIMARY KEY(uuid) ); CREATE INDEX IF NOT EXISTS ON applications (name); // Table 'commands': Teonet applications commands description // - cmdType values: 0 - input; 1 - input/output (same parameters); 2 - output CREATE TABLE IF NOT EXISTS commands( app_id TIMEUUID, cmd INT, type TINYINT, descr TEXT, txt_f BOOLEAN, txt_num TINYINT, txt_descr TEXT, jsonf BOOLEAN, json TEXT, binary_f BOOLEAN, binary_descr TEXT, PRIMARY KEY(app_id, cmd, type) );
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is application functions receiver
func (*App) List ¶
List gets list of applications. Returns list of applications which contain apllication uuid and name
type Com ¶
type Com struct {
// contains filtered or unexported fields
}
Com is command functions receiver
type Teoregistry ¶
type Teoregistry struct {
// contains filtered or unexported fields
}
Teoregistry is the teoregistry packet receiver
func Connect ¶
func Connect(hosts ...string) (tre *Teoregistry, err error)
Connect to the cql cluster and create teoregistry receiver. First parameter is keyspace, next parameters is hosts name (usualy it should be 3 hosts - 3 ScyllaDB nodes)
func (*Teoregistry) Close ¶
func (tre *Teoregistry) Close()
Close closes cql connection and destroy teoregistry receiver