queen

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LINK   = "sys:link"
	UNLINK = "sys:unlink"
	REMOVE = "sys:remove"
	HAND   = "sys:hand"
	HANDED = "sys:handed"
	ATTACH = "sys:attach"
	DETACH = "sys:detach"
	SEND   = "sys:send"
	RECV   = "sys:recv"
)

Variables

This section is empty.

Functions

func GetI32

func GetI32(b []byte, pos int) int32

func InitConnect

func InitConnect(queen *Queen)

func MqttRun added in v0.1.1

func MqttRun(topic string, mqttClient mqtt.Client, queen *Queen)

Types

type CContext

type CContext struct {
	Center   *Center
	Id       int32
	Key      string
	OldValue nson.Value
	Value    nson.Value
}

type CHandler

type CHandler struct {
	// contains filtered or unexported fields
}

type Center

type Center struct {
	// contains filtered or unexported fields
}

func NewCenter

func NewCenter() *Center

func (*Center) All

func (self *Center) All(fn func(CContext)) (id int32)

func (*Center) Get

func (self *Center) Get(key string) (nson.Value, bool)

func (*Center) InitCenter

func (self *Center) InitCenter()

func (*Center) Insert

func (self *Center) Insert(key string, value nson.Value) (nson.Value, bool)

func (*Center) InsertSkipAll added in v0.1.1

func (self *Center) InsertSkipAll(key string, value nson.Value) (nson.Value, bool)

func (*Center) Off

func (self *Center) Off(id int32) (ok bool)

func (*Center) On

func (self *Center) On(key string, fn func(CContext)) (id int32)

func (*Center) Remove

func (self *Center) Remove(key string) (nson.Value, bool)

func (*Center) Run added in v0.1.1

func (self *Center) Run(queen *Queen, event string)

func (*Center) Set

func (self *Center) Set(key string, value nson.Value) (nson.Value, bool)

type Context

type Context struct {
	Queen   *Queen
	Id      int32
	Event   string
	Message nson.Message
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

type Queen

type Queen struct {
	// contains filtered or unexported fields
}

func NewQueen

func NewQueen() *Queen

func (*Queen) Emit

func (self *Queen) Emit(event string, message nson.Message)

func (*Queen) InitQueen

func (self *Queen) InitQueen()

func (*Queen) Off

func (self *Queen) Off(id int32) (ok bool)

func (*Queen) On

func (self *Queen) On(event string, fn func(Context)) (id int32)

func (*Queen) Push added in v0.1.1

func (self *Queen) Push(event string, message nson.Message)

type Task added in v0.1.1

type Task struct {
	// contains filtered or unexported fields
}

type Tasks added in v0.1.1

type Tasks []Task

func (Tasks) Len added in v0.1.1

func (h Tasks) Len() int

func (Tasks) Less added in v0.1.1

func (h Tasks) Less(i, j int) bool

func (*Tasks) Pop added in v0.1.1

func (h *Tasks) Pop() interface{}

func (*Tasks) Push added in v0.1.1

func (h *Tasks) Push(x interface{})

func (Tasks) Swap added in v0.1.1

func (h Tasks) Swap(i, j int)

type Timer added in v0.1.1

type Timer struct {
	// contains filtered or unexported fields
}

func NewTimer added in v0.1.1

func NewTimer() *Timer

func (*Timer) Pop added in v0.1.1

func (t *Timer) Pop() interface{}

func (*Timer) Push added in v0.1.1

func (t *Timer) Push(task Task)

func (*Timer) Run added in v0.1.1

func (t *Timer) Run(queen *Queen)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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