server-go/servlet-context.go

29 lines
439 B
Go
Raw Normal View History

2018-04-04 04:01:26 +00:00
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
}