Documentation ¶
Overview ¶
Package teoapi is the Teonet registry service client package.
Index ¶
- Variables
- type Application
- type Command
- type EventData
- type Packet
- type Stdout
- type Teoapi
- func (api *Teoapi) Add(com *Command) *Teoapi
- func (api *Teoapi) Cmds() (cmds []byte)
- func (api *Teoapi) Count(cmd byte) (count uint64)
- func (api *Teoapi) Descr(cmd byte) (descr string)
- func (api *Teoapi) Destroy()
- func (api *Teoapi) Process(pac Packet, done func()) (err error)
- func (api *Teoapi) ProcessPacket(p interface{})
- func (api *Teoapi) String() (str string)
- type Workers
Constants ¶
This section is empty.
Variables ¶
var MODULE = teokeys.Color(teokeys.ANSIYellow, "(teoapi)")
MODULE is this package module name
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { UUID gocql.UUID Name string Version string Descr string Author string License string Goget string Git string Com []Command }
Application is the Table 'applications': Teonet applications (services) description.
type Command ¶
type Command struct { AppID gocql.UUID Cmd byte Type uint8 Descr string TxtF bool TxtNum uint8 TxtDescr string JSONF bool JSON string BinaryF bool BinaryDescr string Func func(pac Packet) (err error) Message func(pac Packet) (err error) Count uint64 // Command processed count }
Command is the Table 'commands': Teonet applications commands description - cmdType values: 0 - input; 1 - input/output (same parameters); 2 - output
type Packet ¶
type Packet interface { Cmd() byte From() string Data() []byte RemoveTrailingZero(data []byte) []byte }
Packet implements teonet packet interface.
type Stdout ¶
type Stdout struct {
// contains filtered or unexported fields
}
Stdout module receiver
type Teoapi ¶
Teoapi is api receiver.
func New ¶
func New(app *Application, numWorkers ...interface{}) (api *Teoapi)
New create new Teoregistrycli. App is application name. NumWorkers is number of workers to process incoming teonet commands, if this parameter = 0 than workes pool does not created and commands not processed by Teoapi.
func (*Teoapi) ProcessPacket ¶
func (api *Teoapi) ProcessPacket(p interface{})
ProcessPacket send packet to waorkers channel
type Workers ¶
type Workers struct {
// contains filtered or unexported fields
}
Workers receiver
func (*Workers) CommandChan ¶
CommandChan returns channel received packet to execute commands