-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.go
52 lines (40 loc) · 1.07 KB
/
api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package Core
import (
"github.com/StratoAPI/Core/config"
"github.com/StratoAPI/Core/filter"
"github.com/StratoAPI/Core/middleware"
"github.com/StratoAPI/Core/registry"
"github.com/StratoAPI/Core/resource"
"github.com/StratoAPI/Core/schema"
)
func Run() {
// Initialize Core
config.InitializeConfig()
registry.InitializeRegistry()
schema.InitializeSchemas()
resource.InitializeResources()
filter.InitializeFilters()
middleware.InitializeMiddleware()
// Initialize Plugins
registry.InitializePlugins(config.Get().PluginDirectory)
// Initialize Plugin Configs
config.InitializePluginConfigs()
// Initialize Components
registry.InitializeStores()
registry.InitializeFilters()
registry.InitializeFacades()
registry.InitializeMiddlewares()
// Validate Schema Settings
schema.ValidateSchemas()
// Start up stores
registry.StartStores()
// Start up middlewares
registry.StartMiddlewares()
// Start up filters
registry.StartFilters()
// Start up facades
registry.StartFacades()
// Wait for goroutines
registry.WaitForGoroutines()
// TODO Graceful shutdown
}