cityuni-webserver/pageHandler/pages/TestPage.go
Captain ALM 3792ff2a4d
All checks were successful
continuous-integration/drone/push Build is passing
Add a caching flag to page provider content.
2022-07-15 15:37:59 +01:00

40 lines
721 B
Go

package pages
import (
"net/url"
"time"
)
var startTime = time.Now()
func NewTestPage() *TestPage {
return &TestPage{}
}
type TestPage struct {
}
func (tp *TestPage) GetPath() string {
return "/test.go"
}
func (tp *TestPage) GetSupportedURLParameters() []string {
return []string{"test"}
}
func (tp *TestPage) GetLastModified() time.Time {
return startTime
}
func (tp *TestPage) GetContents(urlParameters url.Values) (contentType string, contents []byte, canCache bool) {
if val, ok := urlParameters["test"]; ok {
if len(val) > 0 {
return "text/plain", ([]byte)("Testing!\r\n" + val[0]), len(val) == 1
}
}
return "text/plain", ([]byte)("Testing!"), true
}
func (tp *TestPage) PurgeTemplate() {
}