29 lines
420 B
Go
29 lines
420 B
Go
|
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
|
||
|
}
|