-
Notifications
You must be signed in to change notification settings - Fork 2
/
bundle.go
45 lines (39 loc) · 959 Bytes
/
bundle.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
43
44
45
package test_todo
import (
"net/http"
"strings"
"context"
"gopkg.in/workanator/vuego.v1/app"
"gopkg.in/workanator/vuego.v1/app/facade"
"gopkg.in/workanator/vuego.v1/app/session"
)
func Bundle() app.Bundle {
reactor := facade.NewReactor()
return app.Bundle{
Id: "todo",
Name: "Simple To-Do",
Version: "1.0",
Fs: &facade.MultiFS{},
Lifecycle: app.LifecycleFunc(func(starting bool, b *app.Bundle) error {
println(starting)
return nil
}),
Sessions: &facade.MultiSession{
Who: session.IdentifyFunc(func(r *http.Request) (string, error) {
return (strings.Split(r.RemoteAddr, ":"))[0], nil
}),
Store: &facade.SessionPool{
New: session.StartFunc(func(sessId string) (*session.Session, error) {
return &session.Session{
Context: context.Background(),
Id: sessId,
User: nil,
State: nil,
}, nil
}),
},
EventBus: reactor,
},
Routes: &router{},
}
}