Files
kapow/internal/server/model/handler.go
Roberto Abdelkader Martínez Pérez 47bd2be882 Some fixes suggested by golangci-lint
2019-10-07 08:53:48 +02:00

30 lines
689 B
Go

package model
import (
"net/http"
"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 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
// Request is a pointer to the in-progress request.
Request *http.Request
// Writer is the original http.ResponseWriter of the request.
Writer http.ResponseWriter
}