diff options
Diffstat (limited to 'internal/types/types.go')
| -rw-r--r-- | internal/types/types.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/types/types.go b/internal/types/types.go new file mode 100644 index 0000000..0800994 --- /dev/null +++ b/internal/types/types.go @@ -0,0 +1,27 @@ +package types + +import ( + "io" + "net/http" +) + +type option struct { + Text string + Arc string +} + +type arc struct { + Title string + Story []string + Options []option +} + +type Story map[string]arc + +func (s Story) ServeHTTP(w http.ResponseWriter, r *http.Request) { + arc := r.PathValue("arc") + title := s[arc].Title + + w.Header().Set("Content-Type", "text/plain") + io.WriteString(w, title) +} |
