app/platform: add initial platform service skeleton (#20679)

Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-07-20 15:04:26 +03:00
коммит произвёл GitHub
родитель da7a8a4552
Коммит 6376f7ff55
2 изменённых файлов: 35 добавлений и 0 удалений

16
app/platform/config.go Обычный файл
Просмотреть файл

@@ -0,0 +1,16 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package platform
// ServiceConfig is used to initialize the PlatformService.
// The mandatory fields will be checked during the initialization of the service.
type ServiceConfig struct {
// Mandatory fields
// Optional fields
}
func (c *ServiceConfig) validate() error {
// Mandatory fields need to be checked here
return nil
}

19
app/platform/service.go Обычный файл
Просмотреть файл

@@ -0,0 +1,19 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package platform
// PlatformService is the service for the platform related tasks. It is
// responsible for non-entity related functionalities that are required
// by a product such as database access, configuration access, licensing etc.
type PlatformService struct {
}
// New creates a new PlatformService.
func New(c ServiceConfig) (*PlatformService, error) {
if err := c.validate(); err != nil {
return nil, err
}
return &PlatformService{}, nil
}