Documentation ¶
Index ¶
- func AddServerFactory(fun ServerFunc) bool
- type CallBack
- type CallBackMap
- type CallBackTopic
- type Data
- type Fd
- type Http
- type IO
- type Id
- type Logic
- type LogicRealize
- func (lr *LogicRealize) AddServer(ser Server) bool
- func (lr *LogicRealize) Close(fd *Fd) bool
- func (lr *LogicRealize) Closes(ser Server, fd *Fd) bool
- func (lr *LogicRealize) Connect(ser Server, fd *Fd) bool
- func (lr *LogicRealize) End(ser Server) bool
- func (lr *LogicRealize) GetServer(name string) map[uint]Server
- func (lr *LogicRealize) GetServerList() ServerMap
- func (lr *LogicRealize) Init(ser Server) bool
- func (lr *LogicRealize) News()
- func (lr *LogicRealize) Read(fd *Fd) string
- func (lr *LogicRealize) Receive(ser Server, fd *Fd, data string) bool
- func (lr *LogicRealize) Send(fd *Fd, data string) bool
- func (lr *LogicRealize) SetServer(ser Server) bool
- func (lr *LogicRealize) Write(fd *Fd, data string) bool
- type Message
- type MessageQueue
- type Mq
- type Queue
- type RouterCallBack
- type Server
- type ServerFactory
- type ServerFunc
- type ServerMap
- type ServerRealize
- func (sr *ServerRealize) Close(fd *Fd) bool
- func (sr *ServerRealize) GetName() []string
- func (sr *ServerRealize) GetPort() uint
- func (sr *ServerRealize) GetRaw(name string) interface{}
- func (sr *ServerRealize) Init()
- func (sr *ServerRealize) IsName(name string) bool
- func (sr *ServerRealize) SetIpPort(ip string, port int)
- func (sr *ServerRealize) SetLogic(logic Logic) bool
- func (sr *ServerRealize) SetName(name []string) bool
- type Tcp
- type Template
- type Topic
- func (topic *Topic) AddQueue(number int, size uint) int
- func (topic *Topic) CallBack(callback CallBackTopic, args ...int) bool
- func (topic *Topic) GetName() string
- func (topic *Topic) GetQueue(id int) Queue
- func (topic *Topic) NewQueue(number uint, size uint)
- func (topic *Topic) Read(id, len int) []Message
- func (topic *Topic) Send(msg Message) (int, int)
- func (topic *Topic) SetCallBack(id int, callbak CallBackTopic) bool
- func (topic *Topic) SetName(name string)
- func (topic *Topic) SetPush(id int, _url string)
- type Web
- func (web *Web) AddRouter(reg string, lsp interface{}) bool
- func (web *Web) AddTemplateRouter(reg string, lsp interface{}) bool
- func (web *Web) GetDir() string
- func (web *Web) Run(blocking bool) error
- func (web *Web) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (web *Web) SetDir(dir string)
- func (web *Web) SetRouterAutomatic(ok bool)
- func (web *Web) SetTemplateDir(dir string)
- func (web *Web) Template(w http.ResponseWriter) *Template
- func (web *Web) TplOut(w http.ResponseWriter, path string, data map[string]interface{}) bool
- type WebSocket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddServerFactory ¶
func AddServerFactory(fun ServerFunc) bool
Types ¶
type CallBackMap ¶
type CallBackMap map[string]interface{}
type CallBackTopic ¶
type Fd ¶
func (*Fd) SetValidate ¶
type Http ¶
type Http struct { ServerRealize // contains filtered or unexported fields }
type IO ¶
type IO interface { Close(fd *Fd) bool Read(fd *Fd) string Write(fd *Fd, data string) bool Send(fd *Fd, data string) bool }
socket io
type Logic ¶
type Logic interface { IO News() Init(ser Server) bool End(ser Server) bool SetServer(ser Server) bool AddServer(ser Server) bool GetServer(name string) map[uint]Server GetServerList() ServerMap Connect(ser Server, fd *Fd) bool Receive(ser Server, fd *Fd, data string) bool Closes(ser Server, fd *Fd) bool }
逻辑业务接口
type LogicRealize ¶
type LogicRealize struct {
// contains filtered or unexported fields
}
func (*LogicRealize) AddServer ¶
func (lr *LogicRealize) AddServer(ser Server) bool
func (*LogicRealize) Close ¶
func (lr *LogicRealize) Close(fd *Fd) bool
func (*LogicRealize) End ¶
func (lr *LogicRealize) End(ser Server) bool
func (*LogicRealize) GetServerList ¶
func (lr *LogicRealize) GetServerList() ServerMap
func (*LogicRealize) Init ¶
func (lr *LogicRealize) Init(ser Server) bool
func (*LogicRealize) News ¶
func (lr *LogicRealize) News()
func (*LogicRealize) Read ¶
func (lr *LogicRealize) Read(fd *Fd) string
func (*LogicRealize) Receive ¶
func (lr *LogicRealize) Receive(ser Server, fd *Fd, data string) bool
func (*LogicRealize) SetServer ¶
func (lr *LogicRealize) SetServer(ser Server) bool
type Mq ¶
type Mq MessageQueue
type RouterCallBack ¶
type RouterCallBack func(http.ResponseWriter, *http.Request)
type Server ¶
type Server interface { IO Init() GetPort() uint GetName() []string IsName(name string) bool SetName(name []string) bool Run(blocking bool) error SetIpPort(ip string, port int) SetLogic(logic Logic) bool GetRaw(name string) interface{} // contains filtered or unexported methods }
服务解析处理接口
func NewWebSocket ¶
func NewWebSocket() Server
type ServerFactory ¶
type ServerFactory struct {
// contains filtered or unexported fields
}
func GetServerFactory ¶
func GetServerFactory() *ServerFactory
func NewServerFactory ¶
func NewServerFactory() *ServerFactory
func (*ServerFactory) Create ¶
func (sf *ServerFactory) Create(name string) Server
type ServerRealize ¶
type ServerRealize struct {
// contains filtered or unexported fields
}
func (*ServerRealize) Close ¶
func (sr *ServerRealize) Close(fd *Fd) bool
func (*ServerRealize) GetName ¶
func (sr *ServerRealize) GetName() []string
func (*ServerRealize) GetPort ¶
func (sr *ServerRealize) GetPort() uint
func (*ServerRealize) GetRaw ¶
func (sr *ServerRealize) GetRaw(name string) interface{}
func (*ServerRealize) Init ¶
func (sr *ServerRealize) Init()
func (*ServerRealize) IsName ¶
func (sr *ServerRealize) IsName(name string) bool
func (*ServerRealize) SetIpPort ¶
func (sr *ServerRealize) SetIpPort(ip string, port int)
func (*ServerRealize) SetLogic ¶
func (sr *ServerRealize) SetLogic(logic Logic) bool
func (*ServerRealize) SetName ¶
func (sr *ServerRealize) SetName(name []string) bool
type Tcp ¶
type Tcp struct { ServerRealize // contains filtered or unexported fields }
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
模板
func (*Template) GetContext ¶
func (tpl *Template) GetContext() CallBackMap
type Topic ¶
type Topic struct {
// contains filtered or unexported fields
}
主题/订阅
func (*Topic) SetCallBack ¶
func (topic *Topic) SetCallBack(id int, callbak CallBackTopic) bool
type Web ¶
type Web struct { Http Router map[string]interface{} TplRouter map[string]interface{} // contains filtered or unexported fields }
func (*Web) AddTemplateRouter ¶
添加模板路由处理函数
type WebSocket ¶
type WebSocket struct {
ServerRealize
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.