generated from resonatecoop/id-server-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
service.go
36 lines (30 loc) · 831 Bytes
/
service.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
package webhook
import (
"github.com/resonatecoop/id/config"
"github.com/resonatecoop/id/oauth"
"github.com/uptrace/bun"
)
// Service struct keeps variables for reuse
type Service struct {
cnf *config.Config
db *bun.DB
oauthService oauth.ServiceInterface
}
// NewService returns a new Service instance
func NewService(cnf *config.Config, db *bun.DB, oauthService oauth.ServiceInterface) *Service {
return &Service{
cnf: cnf,
db: db,
oauthService: oauthService,
}
}
// GetConfig returns config.Config instance
func (s *Service) GetConfig() *config.Config {
return s.cnf
}
// GetOauthService returns oauth.Service instance
func (s *Service) GetOauthService() oauth.ServiceInterface {
return s.oauthService
}
// Close stops any running services
func (s *Service) Close() {}