-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimplementation.go
More file actions
32 lines (26 loc) · 901 Bytes
/
implementation.go
File metadata and controls
32 lines (26 loc) · 901 Bytes
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
package main
import (
"bytes"
"html/template"
"github.com/kubex/potens-go/webui"
"github.com/kubex/proto-go/application"
"golang.org/x/net/context"
)
func PageDefinition(ctx context.Context, in *application.HTTPRequest) (*application.HTTPResponse, error) {
response := webui.CreateResponse()
webui.SetPageTitle(response, "Page Title")
return response, nil
}
func DefaultPage(ctx context.Context, in *application.HTTPRequest) (*application.HTTPResponse, error) {
response := webui.CreateResponse()
buf := new(bytes.Buffer)
defaultTemplate := template.Must(template.ParseFiles("templates/default.html"))
defaultTemplate.Execute(buf, "")
response.Body = buf.String()
return response, nil
}
func Panel(ctx context.Context, in *application.HTTPRequest) (*application.HTTPResponse, error) {
response := webui.CreateResponse()
response.Body = "Default Response"
return response, nil
}