-
Notifications
You must be signed in to change notification settings - Fork 1
/
context.go
42 lines (33 loc) · 1.02 KB
/
context.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package strongoapp
import (
"context"
"github.com/strongo/strongoapp/appuser"
)
// ExecutionContext is execution context for UI app
// Contains translator and context.Context
type ExecutionContext interface {
Context() context.Context
}
// AppContext is app context for an app
// Deprecated: use AppUserSettings instead
type AppContext interface {
}
// AppUserSettings is app user record setup for an app
type AppUserSettings interface {
// AppUserCollectionName returns name of a collection for app user records
AppUserCollectionName() string // TODO: Add a link to example of usage
// NewAppUserData TODO: Needs documentation on intended use and examples of usage
NewAppUserData() appuser.BaseUserData // TODO: Consider returning dalgo record
}
type executionContext struct {
c context.Context
}
func (ec executionContext) Context() context.Context {
return ec.c
}
// NewExecutionContext creates new execution context
func NewExecutionContext(c context.Context) ExecutionContext {
return executionContext{
c: c,
}
}