websocket_fasthttp/socket_context.go
crusader 078c776901 ing
2017-11-27 20:23:11 +09:00

29 lines
490 B
Go

package websocket_fasthttp
import (
cuc "git.loafle.net/commons_go/util/context"
)
type SocketContext interface {
cuc.Context
ServerContext() ServerContext
}
func NewSocketContext(serverCTX ServerContext) SocketContext {
sCTX := &socketContext{}
sCTX.Context = cuc.NewContext(serverCTX)
sCTX.serverCTX = serverCTX
return sCTX
}
type socketContext struct {
cuc.Context
serverCTX ServerContext
}
func (sc *socketContext) ServerContext() ServerContext {
return sc.serverCTX
}