Documentation ¶
Overview ¶
Package stats is the Teonet room statistic functions and datbase themes.
Teoroom stats provide teroom database functions executed in cdb.
Install this go package:
go get github.com/kirill-scherba/teonet-go/services/teoroom/cdb
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 content of cql/teoroom.cql file.
For tests repeat the same instructions but use teoroom_test keyspace.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MODULE = teokeys.Color(teokeys.ANSIBrown, "(teoroom-stat)")
MODULE is this package module name
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { RoomID gocql.UUID // Room ID ID gocql.UUID // ID Added time.Time // Time added Loadded time.Time // Time loadded Started time.Time // Time started Leave time.Time // Time leave Disconnected time.Time // Time disconnected GameStat []byte // Game statistic }
Client data structure
type Process ¶
type Process struct{ *Rooms }
Process receiver to process teousers commands
func (*Process) ComClientStatus ¶
ComClientStatus process rooms client state changed command
func (*Process) ComGetRoomsByCreated ¶
ComGetRoomsByCreated get rooms request by Created, read data from database and return answer to request
func (*Process) ComRoomCreated ¶
ComRoomCreated process setCreating, return room uuid.
Input data (binary): room_num uint32.
Output data (byte): id gocql.uuid
func (*Process) ComRoomStateChanged ¶
ComRoomStateChanged process state changed command
type Rooms ¶
type Rooms struct { *Process stats.TeoConnector // contains filtered or unexported fields }
Rooms is the teoroomcdb data structure and methods receiver