-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
nakama.go
41 lines (35 loc) · 929 Bytes
/
nakama.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
package nakama
import (
"database/sql"
_ "embed"
"html/template"
"net/url"
"sync"
"github.com/go-kit/log"
"github.com/nakamauwu/nakama/mailing"
"github.com/nakamauwu/nakama/pubsub"
"github.com/nakamauwu/nakama/storage"
)
//go:embed schema.sql
var Schema string
// Service contains the core business logic separated from the transport layer.
// You can use it to back a REST, gRPC or GraphQL API.
// You must call RunBackgroundJobs afterward.
type Service struct {
Logger log.Logger
DB *sql.DB
Sender mailing.Sender
Origin *url.URL
TokenKey string
PubSub pubsub.PubSub
Store storage.Store
AvatarURLPrefix string
CoverURLPrefix string
MediaURLPrefix string
DisabledDevLogin bool
AllowedOrigins []string
VAPIDPrivateKey string
VAPIDPublicKey string
magicLinkTmplOncer sync.Once
magicLinkTmpl *template.Template
}