From 75c29093b36a7a584fb02c3245c21e97bc21fac3 Mon Sep 17 00:00:00 2001 From: spsobole Date: Mon, 18 Jan 2021 20:02:59 -0700 Subject: [PATCH] Add test code --- auth/auth.go | 5 +++++ test/static/skin/skin.html | 1 + test/templates/footer.html | 4 ++++ test/templates/header.html | 7 +++++++ test/templates/index.html | 3 +++ test/templates/test.html | 3 +++ 6 files changed, 23 insertions(+) create mode 100644 test/static/skin/skin.html create mode 100644 test/templates/footer.html create mode 100644 test/templates/header.html create mode 100644 test/templates/index.html create mode 100644 test/templates/test.html diff --git a/auth/auth.go b/auth/auth.go index ed96972..426f6ab 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -16,6 +16,11 @@ type AuthManager interface { DoAuth(w http.ResponseWriter, r *http.Request) (*AuthData, bool) } +type Authenticator interface { + DoAuth(w http.ResponseWriter, r *http.Request) (*AuthData, bool) +} + + //---------------------------------------------------------------------------------------------------------------------- func NewAuth(kind string) AuthManager { switch kind { diff --git a/test/static/skin/skin.html b/test/static/skin/skin.html new file mode 100644 index 0000000..126dda7 --- /dev/null +++ b/test/static/skin/skin.html @@ -0,0 +1 @@ +skin-file \ No newline at end of file diff --git a/test/templates/footer.html b/test/templates/footer.html new file mode 100644 index 0000000..37bdaad --- /dev/null +++ b/test/templates/footer.html @@ -0,0 +1,4 @@ +{{define "footer"}} + + +{{end}} \ No newline at end of file diff --git a/test/templates/header.html b/test/templates/header.html new file mode 100644 index 0000000..321fb0e --- /dev/null +++ b/test/templates/header.html @@ -0,0 +1,7 @@ +{{define "header"}} + + + + + +{{end}} \ No newline at end of file diff --git a/test/templates/index.html b/test/templates/index.html new file mode 100644 index 0000000..96bcb5f --- /dev/null +++ b/test/templates/index.html @@ -0,0 +1,3 @@ +{{template "header" .}} +Test of things +{{template "footer" .}} \ No newline at end of file diff --git a/test/templates/test.html b/test/templates/test.html new file mode 100644 index 0000000..fe34cc4 --- /dev/null +++ b/test/templates/test.html @@ -0,0 +1,3 @@ +{{template "header" .}} +User: {{ .User }} +{{template "footer" .}} \ No newline at end of file