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