rest

package
v0.0.0-...-de70ca6 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetHandler

type GetHandler struct {
}

GetHandler is the HTTP handler for the "Get Person" endpoint In this simplified example we are assuming all possible errors are user errors and returning "bad request" HTTP 400 or "not found" HTTP 404 There are some programmer errors possible but hopefully these will be caught in testing.

func (*GetHandler) ServeHTTP

func (h *GetHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP implements http.Handler

type ListHandler

type ListHandler struct {
}

ListHandler is the HTTP handler for the "List Do people" endpoint In this simplified example we are assuming all possible errors are system errors (HTTP 500)

func (*ListHandler) ServeHTTP

func (h *ListHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP implements http.Handler

type RegisterHandler

type RegisterHandler struct {
}

RegisterHandler is the HTTP handler for the "Register" endpoint In this simplified example we are assuming all possible errors are user errors and returning "bad request" HTTP 400. There are some programmer errors possible but hopefully these will be caught in testing.

func (*RegisterHandler) ServeHTTP

func (h *RegisterHandler) ServeHTTP(response http.ResponseWriter, request *http.Request)

ServeHTTP implements http.Handler

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the HTTP REST server

func New

func New(address string) *Server

New will create and initialize the server

func (*Server) Listen

func (s *Server) Listen(stop <-chan struct{})

Listen will start a HTTP rest for this service

Jump to

Keyboard shortcuts

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