Documentation ¶
Index ¶
- Constants
- func CreateLead(w http.ResponseWriter, r *http.Request)
- func GetLeads(w http.ResponseWriter, r *http.Request)
- func HelloName(w http.ResponseWriter, r *http.Request)
- func HelloWorld(w http.ResponseWriter, r *http.Request)
- func NewRouter(db *database.DB) http.Handler
- func RequireAuthentication(next http.Handler) http.Handler
- func UpdateLead(w http.ResponseWriter, r *http.Request)
- type HelloResponse
Constants ¶
View Source
const ValidBearer = "123456"
ValidBearer is a hardcoded bearer token for demonstration purposes.
Variables ¶
This section is empty.
Functions ¶
func CreateLead ¶
func CreateLead(w http.ResponseWriter, r *http.Request)
CreateLead allows the creation of a lead
func GetLeads ¶
func GetLeads(w http.ResponseWriter, r *http.Request)
GetLeads is a queryable endpoint that pulls Leads from the database
func HelloName ¶
func HelloName(w http.ResponseWriter, r *http.Request)
HelloName returns a personalized JSON message
func HelloWorld ¶
func HelloWorld(w http.ResponseWriter, r *http.Request)
HelloWorld returns a basic "Hello World!" message
func RequireAuthentication ¶
RequireAuthentication is an example middleware handler that checks for a hardcoded bearer token. This can be used to verify session cookies, JWTs and more.
func UpdateLead ¶
func UpdateLead(w http.ResponseWriter, r *http.Request)
UpdateLead allows a Lead to be updated.
Types ¶
type HelloResponse ¶
HelloResponse is the JSON representation for a customized message
Click to show internal directories.
Click to hide internal directories.