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

This commit is contained in:
Ibrahim Serdar Acikgoz
2022-07-20 15:04:26 +03:00
committed by GitHub
parent da7a8a4552
commit 6376f7ff55
2 changed files with 35 additions and 0 deletions
+16
View File
@@ -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
View File
@@ -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
}