* app: improve plugin interfaces

* add documentation

* improve doc

* add error id

* add more info to readme
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-06-13 09:36:43 +03:00
коммит произвёл GitHub
родитель 7c1b8cd937
Коммит 39991d236b
12 изменённых файлов: 566 добавлений и 10 удалений

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

@@ -96,6 +96,9 @@ const (
UserKey ServiceKey = "user"
PermissionsKey ServiceKey = "permissions"
RouterKey ServiceKey = "router"
BotKey ServiceKey = "bot"
LogKey ServiceKey = "log"
HooksKey ServiceKey = "hooks"
)
type Server struct {
@@ -394,8 +397,10 @@ func NewServer(options ...Option) (*Server, error) {
LicenseKey: s.licenseWrapper,
FilestoreKey: s.filestore,
ClusterKey: s.clusterWrapper,
TeamKey: s.teamService,
UserKey: s.userService,
UserKey: New(ServerConnector(s.Channels())),
LogKey: &logWrapper{
srv: s,
},
}
// Step 8: Initialize products.
@@ -1174,7 +1179,15 @@ func stripPort(hostport string) string {
func (s *Server) Start() error {
// Start products.
// This needs to happen before because products are dependent on the HTTP server.
// make sure channels starts first
if err := s.products["channels"].Start(); err != nil {
return errors.Wrap(err, "Unable to start channels")
}
for name, product := range s.products {
if name == "channels" {
continue
}
if err := product.Start(); err != nil {
return errors.Wrapf(err, "Unable to start %s", name)
}