Documentation ¶
Index ¶
- func HttpResponseBadRequest(resp http.ResponseWriter, msg string)
- func HttpResponseInternalError(resp http.ResponseWriter, err error)
- func HttpResponseSuccess(resp http.ResponseWriter, data interface{})
- func HttpUnauthorized(resp http.ResponseWriter, msg string)
- func WriteHttpResponse(resp http.ResponseWriter, code int, data Response)
- type AddTaskRequest
- type Response
- type ToDoHttpServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HttpResponseBadRequest ¶
func HttpResponseBadRequest(resp http.ResponseWriter, msg string)
func HttpResponseInternalError ¶
func HttpResponseInternalError(resp http.ResponseWriter, err error)
func HttpResponseSuccess ¶
func HttpResponseSuccess(resp http.ResponseWriter, data interface{})
func HttpUnauthorized ¶
func HttpUnauthorized(resp http.ResponseWriter, msg string)
func WriteHttpResponse ¶
func WriteHttpResponse(resp http.ResponseWriter, code int, data Response)
Types ¶
type AddTaskRequest ¶
type AddTaskRequest struct {
Content string `json:"content"`
}
type Response ¶
type Response struct { Error string `json:"error,omitempty"` Data interface{} `json:"data,omitempty"` }
type ToDoHttpServer ¶
type ToDoHttpServer struct { JWTKey string // contains filtered or unexported fields }
func NewToDoHttpServer ¶
func NewToDoHttpServer(jwtKey string, srv *services.ToDoService) *ToDoHttpServer
func (*ToDoHttpServer) Listen ¶
func (s *ToDoHttpServer) Listen(port int) error
func (*ToDoHttpServer) ServeHTTP ¶
func (s *ToDoHttpServer) ServeHTTP(resp http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.