server-go/servlet-ctx.go

29 lines
420 B
Go
Raw Normal View History

2018-08-22 08:37:12 +00:00
package server
import (
ouc "git.loafle.net/overflow/util-go/ctx"
)
type ServletCtx interface {
ouc.Ctx
ServerCtx() ServerCtx
}
func NewServletContext(parent ouc.Ctx, serverCtx ServerCtx) ServletCtx {
return &servletCtx{
Ctx: ouc.NewCtx(parent),
serverCtx: serverCtx,
}
}
type servletCtx struct {
ouc.Ctx
serverCtx ServerCtx
}
func (sc *servletCtx) ServerCtx() ServerCtx {
return sc.serverCtx
}