Documentation ¶
Overview ¶
Package users creates or fetchs user data from Cassandra
Package users creates or fetchs user data from Cassandra ¶
Package users creates or fetchs user data from Cassandra ¶
Package users creates or fetchs user data from Cassandra
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enrich ¶
Enrich -- turns an array of user UUIDs into a map of {uuid: "firstname lastname"} params: uuids - array of user UUIDs to fetch returns: a map[string]string of {uuid: "firstname lastname"}
func Get ¶
func Get(w http.ResponseWriter, r *http.Request)
Get -- handles GET request to /users/ to fetch all users params: w - response writer for building JSON payload response r - request reader to fetch form data or url params (unused here)
Types ¶
type AllUsersResponse ¶
type AllUsersResponse struct {
Users []User `json:"users"`
}
AllUsersResponse to form payload of an array of User structs
type ErrorResponse ¶
type ErrorResponse struct {
Errors []string `json:"errors"`
}
ErrorResponse returns an array of error strings if appropriate
type GetUserResponse ¶
type GetUserResponse struct {
User User `json:"user"`
}
GetUserResponse to form payload returning a single User struct
type NewUserResponse ¶
NewUserResponse builds a payload of new user resource ID