server-go/servlet-context.go
crusader f85b949e66 ing
2018-04-04 13:01:26 +09:00

29 lines
439 B
Go

package server
import (
cuc "git.loafle.net/commons/util-go/context"
)
type ServletCtx interface {
cuc.Context
ServerCtx() ServerCtx
}
func NewServletContext(parent cuc.Context, serverCtx ServerCtx) ServletCtx {
return &servletCtx{
Context: cuc.NewContext(parent),
serverCtx: serverCtx,
}
}
type servletCtx struct {
cuc.Context
serverCtx ServerCtx
}
func (sc *servletCtx) ServerCtx() ServerCtx {
return sc.serverCtx
}