github.com/predbdotovh/pre-api@v0.0.0-20211230223408-096f265fde6a/routes.go (about)

     1  package main
     2  
     3  import (
     4  	"net/http"
     5  )
     6  
     7  type muxRoute struct {
     8  	Name    string
     9  	Method  string
    10  	Pattern string
    11  	Handler http.HandlerFunc
    12  }
    13  
    14  type muxRoutes []muxRoute
    15  type jsonMuxRoutes map[string]muxRoutes
    16  
    17  var jsonRoutes = jsonMuxRoutes{
    18  	"v1": muxRoutes{
    19  		muxRoute{"Root", "GET", "/", rootHandlerV1},
    20  		muxRoute{"Teams", "GET", "/teams", teamsHandlerV1},
    21  		muxRoute{"Stats", "GET", "/stats", statsHandlerV1},
    22  		muxRoute{"Live", "GET", "/live", liveHandlerV1},
    23  		muxRoute{"Rss", "GET", "/rss", rssHandlerV1},
    24  		muxRoute{"WS", "GET", "/ws", websocketHandlerV1},
    25  	},
    26  }
    27  
    28  var triggerRoutes = muxRoutes{
    29  	muxRoute{"NukeTrigger", "POST", "/nuke", nukeTriggerHandlerV1},
    30  	muxRoute{"PreTrigger", "POST", "/{action}", preTriggerHandlerV1},
    31  }