2018-01-29 16:52:59 +01:00
|
|
|
package services
|
|
|
|
|
|
|
|
type Config struct {
|
2018-02-03 18:14:47 +01:00
|
|
|
CollectionPath string
|
|
|
|
Sessions *SessionsConfig
|
2018-01-29 16:52:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type Provider struct {
|
2018-02-03 18:14:47 +01:00
|
|
|
ClientCollection *ClientCollection
|
|
|
|
Sessions *Sessions
|
2018-01-29 16:52:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewProvider returns the ServiceProvider
|
|
|
|
func NewProvider(conf *Config) *Provider {
|
|
|
|
var provider = &Provider{}
|
|
|
|
|
2018-02-03 18:14:47 +01:00
|
|
|
provider.ClientCollection = NewClientCollection(conf.CollectionPath)
|
2018-01-29 16:52:59 +01:00
|
|
|
provider.Sessions = NewSessions(conf.Sessions)
|
|
|
|
|
|
|
|
return provider
|
|
|
|
}
|