server/socket_context.go
crusader ec72c171fb ing
2017-11-29 09:51:41 +09:00

29 lines
478 B
Go

package server
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
}