Documentation
¶
Index ¶
- func CreateTask(d models.TaskStore, w http.ResponseWriter, r *http.Request)
- func DeleteTask(d models.TaskStore, w http.ResponseWriter, r *http.Request)
- func GetAllTasks(d models.TaskStore, w http.ResponseWriter, r *http.Request)
- func GetTask(d models.TaskStore, w http.ResponseWriter, r *http.Request)
- func GetUser(d *models.DataStore, w http.ResponseWriter, r *http.Request)
- func Healthcheck(w http.ResponseWriter, r *http.Request)
- func Login(authMod common.Authorizer, d models.UserStore, w http.ResponseWriter, ...)
- func Register(authMod common.Authorizer, d models.UserStore, w http.ResponseWriter, ...)
- func UpdateTask(d models.TaskStore, w http.ResponseWriter, r *http.Request)
- func WithDb(store models.DataStorer, ...) http.Handler
- func WithDbAndAuth(authModule common.Authorizer, store models.DataStorer, ...) http.HandlerFunc
- type CreatedUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTask ¶
func DeleteTask ¶
func GetAllTasks ¶
gets all tasks for a given user
func Healthcheck ¶
func Healthcheck(w http.ResponseWriter, r *http.Request)
func Login ¶
func Login(authMod common.Authorizer, d models.UserStore, w http.ResponseWriter, r *http.Request)
Login, attempts to log in a user and writes the response back the ResponseWriter
func Register ¶
func Register(authMod common.Authorizer, d models.UserStore, w http.ResponseWriter, r *http.Request)
Registers a user that includes all the common fields from models.User
func UpdateTask ¶
func WithDb ¶
func WithDb(store models.DataStorer, fn func(models.TaskStore, http.ResponseWriter, *http.Request)) http.Handler
With db wraps each controller that needs the db with a new session this is important to handle requests concurrently This is only used by the task handlers, which only ever need the TaskStore implementation Going to build this function specifically for that as its then easier to test those functions
func WithDbAndAuth ¶
func WithDbAndAuth( authModule common.Authorizer, store models.DataStorer, fn func(common.Authorizer, models.UserStore, http.ResponseWriter, *http.Request), ) http.HandlerFunc
We will need withAuth module, for register/login routes trying not to populate namespace, so adding another wrapper to deliver db/auth
Types ¶
type CreatedUser ¶
Click to show internal directories.
Click to hide internal directories.