* Creating empty Channels shell This is the first step in moving to a product-based isolated architecture. For now, Channels is empty and does not contain anything. Next step is to change App to contain Channels instead of Server. Some of the initialization code in NewServer would need to be moved inside NewChannels. This would complete the full pass-through mode of accessing everything. The last step would be to gradually move Channels related fields from Server into Channels, keeping Server to be just the global level struct. ```release-note NONE ``` * fix vet failure ```release-note NONE ```
16 строки
339 B
Go
16 строки
339 B
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package app
|
|
|
|
type Product interface {
|
|
Start() error
|
|
Stop() error
|
|
}
|
|
|
|
var products = make(map[string]func(*Server) (Product, error))
|
|
|
|
func RegisterProduct(name string, f func(*Server) (Product, error)) {
|
|
products[name] = f
|
|
}
|