1
0
Fork 0
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:
Harvey Kandola 2017-07-24 19:10:49 +01:00
parent 792c3e2ce8
commit 27640dffc4
15 changed files with 315 additions and 82 deletions

View file

@ -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)}
}