Documentation ¶
Index ¶
- Variables
- func AddServerHandle(handle ServeHandle)
- func GetWait(id uint64) (b chan []byte, c chan bool, t *time.Timer, e error)
- func HandFunc(typ uint16, fun Header)
- func NewConfig(jsonFile string) *Configure
- func NewServer(conf *Configure)
- func RunHand(w ResponseWrite, r Request, fun Header)
- func ServerListen()
- func StopId(id uint64)
- func UserAdd(key interface{}, info UserConn) error
- func UserDel(key interface{}) error
- func UserSet(key interface{}, info UserConn) error
- func WaitId(id uint64, callback func()) (b chan []byte, c chan bool, t *time.Timer)
- type NadoServer
- type UserConn
- type UserList
- type UserRoute
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Error = log.New(os.Stderr, "ERROR ", log.Lshortfile|log.LstdFlags) Debug = log.New(os.Stderr, "DEBUG ", log.Lshortfile|log.LstdFlags) )
View Source
var RouterToConsumer Header
View Source
var Stop = make(chan bool)
View Source
var Users = new(UserList)
View Source
var WriteToServer = make(chan RequestResponse)
Functions ¶
func AddServerHandle ¶
func AddServerHandle(handle ServeHandle)
func ServerListen ¶
func ServerListen()
Types ¶
type NadoServer ¶
type NadoServer struct { sync.RWMutex AddRoute chan *UserRoute DelRoute chan uint64 Routes map[uint64]chan []byte // contains filtered or unexported fields }
var DefaultServer *NadoServer
** 默认处理方式 *
func (*NadoServer) AddServeHandle ¶
func (self *NadoServer) AddServeHandle(s ServeHandle)
func (*NadoServer) HandFunc ¶
func (self *NadoServer) HandFunc(typ uint16, fun Header)
func (*NadoServer) RunHandler ¶
func (self *NadoServer) RunHandler(w ResponseWrite, r Request, defaultFun Header)
Click to show internal directories.
Click to hide internal directories.