2022-07-14 23:25:43 +01:00
|
|
|
package pageHandler
|
|
|
|
|
2022-07-16 22:20:56 +01:00
|
|
|
import "golang.captainalm.com/cityuni-webserver/pageHandler/pages/index"
|
|
|
|
|
2022-07-14 23:25:43 +01:00
|
|
|
var providers map[string]PageProvider
|
|
|
|
|
2022-07-16 00:53:50 +01:00
|
|
|
func GetProviders(cacheTemplates bool, dataStorage string, pageHandler *PageHandler) map[string]PageProvider {
|
2022-07-14 23:25:43 +01:00
|
|
|
if providers == nil {
|
|
|
|
providers = make(map[string]PageProvider)
|
2022-07-16 00:53:50 +01:00
|
|
|
if pageHandler != nil {
|
|
|
|
infoPage := newGoInfoPage(pageHandler, dataStorage, cacheTemplates)
|
|
|
|
providers[infoPage.GetPath()] = infoPage //Go Information Page
|
|
|
|
}
|
2022-07-16 22:20:56 +01:00
|
|
|
indexPage := index.NewPage(dataStorage, cacheTemplates)
|
|
|
|
providers[indexPage.GetPath()] = indexPage
|
2022-07-14 23:25:43 +01:00
|
|
|
}
|
|
|
|
return providers
|
|
|
|
}
|