-
Notifications
You must be signed in to change notification settings - Fork 0
/
engine.go
42 lines (37 loc) · 936 Bytes
/
engine.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 auth
import (
"github.com/ikeikeikeike/go-sitemap-generator/stm"
"github.com/jinzhu/gorm"
"github.com/kapmahc/fly/web"
"golang.org/x/tools/blog/atom"
)
// Engine engine
type Engine struct {
Dao *Dao `inject:""`
Db *gorm.DB `inject:""`
Security *web.Security `inject:""`
I18n *web.I18n `inject:""`
Jwt *Jwt `inject:""`
Uploader web.Uploader `inject:""`
Settings *web.Settings `inject:""`
Queue *web.Queue `inject:""`
}
// Atom rss.atom
func (p *Engine) Atom(lang string) ([]*atom.Entry, error) {
return []*atom.Entry{}, nil
}
// Sitemap sitemap.xml.gz
func (p *Engine) Sitemap() ([]stm.URL, error) {
urls := []stm.URL{
{"loc": "/users"},
{"loc": "/users/sign-in"},
{"loc": "/users/sign-up"},
{"loc": "/users/confirm"},
{"loc": "/users/forgot-password"},
{"loc": "/users/unlock"},
}
return urls, nil
}
func init() {
web.Register(&Engine{})
}