You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
377 B

  1. package main
  2. import (
  3. "net/http"
  4. )
  5. type Route struct {
  6. Name string
  7. Method string
  8. Pattern string
  9. HandlerFunc http.HandlerFunc
  10. }
  11. type Routes []Route
  12. var routes = Routes{
  13. Route{
  14. "Index",
  15. "GET",
  16. "/",
  17. Index,
  18. },
  19. Route{
  20. "ImageShow",
  21. "GET",
  22. "/images/{imageName}",
  23. ImageShow,
  24. },
  25. Route{
  26. "NewImage",
  27. "POST",
  28. "/image",
  29. NewImage,
  30. },
  31. }