Browse Source

I need to take a nap

master
SeraphJACK 3 years ago
parent
commit
b2605422d7
Signed by: SeraphJACK <seraphjack@outlook.com> GPG Key ID: 14162B46567AB06F
9 changed files with 39 additions and 2 deletions
  1. +7
    -0
      http/challenge.go
  2. +6
    -2
      http/server.go
  3. +7
    -0
      http/static.go
  4. +7
    -0
      http/submit.go
  5. +4
    -0
      main.go
  6. +1
    -0
      storage/ip.go
  7. +1
    -0
      storage/schema.go
  8. +5
    -0
      storage/storage.go
  9. +1
    -0
      storage/vote.go

+ 7
- 0
http/challenge.go View File

@@ -0,0 +1,7 @@
package http

import "net/http"

func handleChallenge(w http.ResponseWriter, r *http.Request) {
// TODO
}

+ 6
- 2
http/server.go View File

@@ -8,11 +8,15 @@ import (

func Start(listen string) error {
router := mux.NewRouter()
// TODO add handlers

router.HandleFunc("/challenge", handleChallenge)
router.HandleFunc("/submit", handleSubmit)
router.HandleFunc("/", handleStatic)

err := http.ListenAndServe(listen, router)

if err != nil {
log.Println("HTTP server listening on ", listen)
}
return err

}

+ 7
- 0
http/static.go View File

@@ -0,0 +1,7 @@
package http

import "net/http"

func handleStatic(w http.ResponseWriter, r *http.Request) {
// TODO
}

+ 7
- 0
http/submit.go View File

@@ -0,0 +1,7 @@
package http

import "net/http"

func handleSubmit(w http.ResponseWriter, r *http.Request) {
// TODO
}

+ 4
- 0
main.go View File

@@ -3,6 +3,7 @@ package main
import (
"flag"
"votes/http"
"votes/storage"
)

func main() {
@@ -10,5 +11,8 @@ func main() {
flag.StringVar(&l, "l", "127.0.0.1:8080", "Listen")
flag.Parse()

if err := storage.Init(); err != nil {
return
}
_ = http.Start(l)
}

+ 1
- 0
storage/ip.go View File

@@ -0,0 +1 @@
package storage

+ 1
- 0
storage/schema.go View File

@@ -0,0 +1 @@
package storage

+ 5
- 0
storage/storage.go View File

@@ -0,0 +1,5 @@
package storage

func Init() error {
// TODO
}

+ 1
- 0
storage/vote.go View File

@@ -0,0 +1 @@
package storage

Loading…
Cancel
Save