mirror of
https://github.com/documize/community.git
synced 2025-07-24 23:59:47 +02:00
pointers to Runtime!
This commit is contained in:
parent
792c3e2ce8
commit
27640dffc4
15 changed files with 315 additions and 82 deletions
|
@ -53,12 +53,11 @@ func GetRequestContext(r *http.Request) RequestContext {
|
|||
|
||||
// StoreContext provides data persistence methods with runtime and request context.
|
||||
type StoreContext struct {
|
||||
Runtime env.Runtime
|
||||
Runtime *env.Runtime
|
||||
Context RequestContext
|
||||
}
|
||||
|
||||
// NewContexts returns request scoped user context and store context for persistence logic.
|
||||
func NewContexts(rt env.Runtime, r *http.Request) (RequestContext, StoreContext) {
|
||||
ctx := GetRequestContext(r)
|
||||
return ctx, StoreContext{Runtime: rt, Context: ctx}
|
||||
// NewContext returns request scoped user context and store context for persistence logic.
|
||||
func NewContext(rt *env.Runtime, r *http.Request) StoreContext {
|
||||
return StoreContext{Runtime: rt, Context: GetRequestContext(r)}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue