Skip to content

Generic Request and Response Http and APIGateway

Notifications You must be signed in to change notification settings

lbernardo/entrypoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Entrypoint

Install

go get github.com/lbernardo/entrypoint

Use

Convert Http Request to Generic Request

request := entrypoint.NewRequestByHttp(r)  // r is *http.Request and request is entrypoint.Request

Convert Http Response to Generic Response

response := entrypoint.NewResponseToHttp(w, http.StatusOK, responseGen) // response is entrypoint.Response 

Convert APIGateway Request to Generic Request

entrypoint.NewRequestByApiGateway(entrypoint.RequestAPIGateway)

Convert Generic Response to API Gateway response

entrypoint.NewResponseToApiGateway(status, response) // status is int and response is entrypoint.Response

About

Generic Request and Response Http and APIGateway

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages