server

package
v0.0.2-0...-d9a3ee1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL