* add license service interface

* add wrapper

* remove wrapper from channels struct until its being used

* add comments
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-03-01 15:14:43 +03:00
коммит произвёл GitHub
родитель 229200720c
Коммит f2471200f9
4 изменённых файлов: 76 добавлений и 3 удалений

Просмотреть файл

@@ -89,7 +89,8 @@ var SentryDSN = "placeholder_sentry_dsn"
type ServiceKey string
const (
ConfigKey ServiceKey = "config"
ConfigKey ServiceKey = "config"
LicenseKey ServiceKey = "license"
)
type Server struct {
@@ -141,6 +142,7 @@ type Server struct {
licenseValue atomic.Value
clientLicenseValue atomic.Value
licenseListeners map[string]func(*model.License, *model.License)
licenseWrapper *licenseWrapper
timezones *timezones.Timezones
@@ -255,10 +257,15 @@ func NewServer(options ...Option) (*Server, error) {
mlog.Info("Server is initializing...", mlog.String("go_version", runtime.Version()))
s.httpService = httpservice.MakeHTTPService(s)
s.licenseWrapper = &licenseWrapper{
srv: s,
}
serviceMap := map[ServiceKey]interface{}{
ConfigKey: s.configStore,
ConfigKey: s.configStore,
LicenseKey: s.licenseWrapper,
}
// Step 3: Initialize products.
// Depends on s.httpService.
for name, initializer := range products {