Documentation ¶
Index ¶
- func CreateNote(w http.ResponseWriter, r *http.Request)
- func CreateTask(w http.ResponseWriter, r *http.Request)
- func DeleteNote(w http.ResponseWriter, r *http.Request)
- func DeleteTask(w http.ResponseWriter, r *http.Request)
- func GetNoteById(w http.ResponseWriter, r *http.Request)
- func GetNotes(w http.ResponseWriter, r *http.Request)
- func GetNotesByTask(w http.ResponseWriter, r *http.Request)
- func GetTaskById(w http.ResponseWriter, r *http.Request)
- func GetTasks(w http.ResponseWriter, r *http.Request)
- func GetTasksByUser(w http.ResponseWriter, r *http.Request)
- func Login(w http.ResponseWriter, r *http.Request)
- func Register(w http.ResponseWriter, r *http.Request)
- func UpdateNote(w http.ResponseWriter, r *http.Request)
- func UpdateTask(w http.ResponseWriter, r *http.Request)
- type AuthUserModel
- type AuthUserResource
- type Context
- type LoginModel
- type LoginResource
- type NoteModel
- type NoteResource
- type NotesResource
- type TaskResource
- type TasksResource
- type UserResource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNote ¶
func CreateNote(w http.ResponseWriter, r *http.Request)
Handler for HTTP Post - "/notes" Insert a new Note document for a TaskId
func CreateTask ¶
func CreateTask(w http.ResponseWriter, r *http.Request)
Handler for HTTP Post - "/tasks" Insert a new Task document
func DeleteNote ¶
func DeleteNote(w http.ResponseWriter, r *http.Request)
Handler for HTTP Delete - "/notes/{id}" Delete an existing Note document
func DeleteTask ¶
func DeleteTask(w http.ResponseWriter, r *http.Request)
Handler for HTTP Delete - "/tasks/{id}" Delete an existing Task document
func GetNoteById ¶
func GetNoteById(w http.ResponseWriter, r *http.Request)
Handler for HTTP Get - "/notes/{id}" Returns a single Note document by id
func GetNotes ¶
func GetNotes(w http.ResponseWriter, r *http.Request)
Handler for HTTP Get - "/notes" Returns all Note documents
func GetNotesByTask ¶
func GetNotesByTask(w http.ResponseWriter, r *http.Request)
Handler for HTTP Get - "/notes/tasks/{id} Returns all Notes documents under a TaskId
func GetTaskById ¶
func GetTaskById(w http.ResponseWriter, r *http.Request)
Handler for HTTP Get - "/tasks/{id}" Returns a single Task document by id
func GetTasks ¶
func GetTasks(w http.ResponseWriter, r *http.Request)
Handler for HTTP Get - "/tasks" Returns all Task documents
func GetTasksByUser ¶
func GetTasksByUser(w http.ResponseWriter, r *http.Request)
Handler for HTTP Get - "/tasks/users/{id}" Returns all Tasks created by a User
func Login ¶
func Login(w http.ResponseWriter, r *http.Request)
Handler for HTTP Post - "/users/login" Authenticate with username and apssword
func Register ¶
func Register(w http.ResponseWriter, r *http.Request)
Handler for HTTP Post - "/users/register" Add a new User document
func UpdateNote ¶
func UpdateNote(w http.ResponseWriter, r *http.Request)
Handler for HTTP Put - "/notes/{id}" Update an existing Note document
func UpdateTask ¶
func UpdateTask(w http.ResponseWriter, r *http.Request)
Handler for HTTP Put - "/tasks/{id}" Update an existing Task document
Types ¶
type AuthUserModel ¶
Model for authorized user with access token
type AuthUserResource ¶
type AuthUserResource struct {
Data AuthUserModel `json:"data"`
}
Response for authorized user Post - /user/login
type Context ¶
type Context struct {
MongoSession *mgo.Session
}
Struct used for maintaining HTTP Request Context
func (*Context) DbCollection ¶
Returns mgo.collection for the given name
type LoginModel ¶
Model for authentication
type LoginResource ¶
type LoginResource struct {
Data LoginModel `json:"data"`
}
For Post - /user/login
type NotesResource ¶
For Get - /notes For /notes/tasks/id
type TaskResource ¶
For Post/Put - /tasks For Get - /tasks/id
type TasksResource ¶
For Get - /tasks
type UserResource ¶
For Post - /user/register