diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2021-03-04 19:44:02 -0500 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2021-03-04 19:48:27 -0500 |
| commit | b9bb17044a8c2b47c7e96660e27ab645f82bec9d (patch) | |
| tree | 6c5bff2c5eaaebfc1ce9b01119308dcc39a75253 /cmd/web/index.go | |
| parent | 3b6f5647b0689abf04be73c3cf00297051753435 (diff) | |
| download | steam-export-b9bb17044a8c2b47c7e96660e27ab645f82bec9d.tar.gz steam-export-b9bb17044a8c2b47c7e96660e27ab645f82bec9d.tar.xz | |
Further refactoring.
Diffstat (limited to 'cmd/web/index.go')
| -rw-r--r-- | cmd/web/index.go | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/cmd/web/index.go b/cmd/web/index.go deleted file mode 100644 index 7291af0..0000000 --- a/cmd/web/index.go +++ /dev/null @@ -1,39 +0,0 @@ -package main - -import ( - "net/http" - - "riedstra.dev/mitch/steam-export/steam" -) - -func (a *App) HandleIndex(w http.ResponseWriter, r *http.Request) { - // During rendering of the template I believe it's - // mutating during the sort of keys, so Lib no longer - // is an RWMutex and we're just locking this as if - // we're writing to it - a.Library.Lock() - defer a.Library.Unlock() - a.Status.Lock() - defer a.Status.Unlock() - - err := a.Templates.ExecuteTemplate(w, "index", - struct { - Lib *steam.Library - Info *statusInfo - Local bool - HostIP string - Port string - Version string - }{ - &a.Library.Library, - a.Status, - isLocal(r.RemoteAddr), - getHostIP(), - getPort(), - Version, - }) - if err != nil { - Logger.Printf("While Rendering template: %s", err) - } - Logger.Printf("Client %s Index page", r.RemoteAddr) -} |
