Some fixes suggested by golangci-lint
This commit is contained in:
@@ -5,10 +5,25 @@ import (
|
||||
"sync"
|
||||
)
|
||||
|
||||
// Handler represents an open HTTP connection in the User Server.
|
||||
//
|
||||
// This struct contains the connection Writer and Request to be managed
|
||||
// by endpoints of the Data Server.
|
||||
type Handler struct {
|
||||
Id string
|
||||
Route *Route
|
||||
// ID is unique identifier of the request.
|
||||
ID string
|
||||
|
||||
// Route is a reference to the original route that matched this
|
||||
// request.
|
||||
Route *Route
|
||||
|
||||
// Writing is a mutex that prevents two goroutines from writing at
|
||||
// the same time in the response.
|
||||
Writing sync.Mutex
|
||||
Writer http.ResponseWriter
|
||||
|
||||
// Request is a pointer to the in-progress request.
|
||||
Request *http.Request
|
||||
|
||||
// Writer is the original http.ResponseWriter of the request.
|
||||
Writer http.ResponseWriter
|
||||
}
|
||||
|
||||
@@ -1,9 +1,25 @@
|
||||
package model
|
||||
|
||||
// Route contains the data needed to represent a Kapow! user route.
|
||||
type Route struct {
|
||||
Id string `json:"id"`
|
||||
Method string `json:"method"`
|
||||
Pattern string `json:"url_pattern"`
|
||||
// ID is the unique identifier of the Route.
|
||||
ID string `json:"id"`
|
||||
|
||||
// Method is the HTTP method that will match this Route.
|
||||
Method string `json:"method"`
|
||||
|
||||
// Pattern is the gorilla/mux path pattern that will match this
|
||||
// Route.
|
||||
Pattern string `json:"url_pattern"`
|
||||
|
||||
// Entrypoint is the string that will be executed when the Route
|
||||
// match.
|
||||
//
|
||||
// This string will be split according to the shell parsing rules to
|
||||
// be passed as a list to exec.Command.
|
||||
Entrypoint string `json:"entrypoint"`
|
||||
Command string `json:"command"`
|
||||
|
||||
// Command is the last argument to be passed to exec.Command when
|
||||
// executing the Entrypoint
|
||||
Command string `json:"command"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user