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)
CreateNote inserts a new Note document for a TaskId Handler for HTTP Post - "/notes"
func CreateTask ¶
func CreateTask(w http.ResponseWriter, r *http.Request)
CreateTask insert a new Task document Handler for HTTP Post - "/tasks
func DeleteNote ¶
func DeleteNote(w http.ResponseWriter, r *http.Request)
DeleteNote deletes an existing Note document Handler for HTTP Delete - "/notes/{id}"
func DeleteTask ¶
func DeleteTask(w http.ResponseWriter, r *http.Request)
DeleteTask deelete an existing Task document Handler for HTTP Delete - "/tasks/{id}"
func GetNoteByID ¶
func GetNoteByID(w http.ResponseWriter, r *http.Request)
GetNoteByID returns a single Note document by id Handler for HTTP Get - "/notes/{id}"
func GetNotes ¶
func GetNotes(w http.ResponseWriter, r *http.Request)
GetNotes returns all Note documents Handler for HTTP Get - "/notes"
func GetNotesByTask ¶
func GetNotesByTask(w http.ResponseWriter, r *http.Request)
GetNotesByTask returns all Notes documents under a TaskId Handler for HTTP Get - "/notes/tasks/{id}
func GetTaskByID ¶
func GetTaskByID(w http.ResponseWriter, r *http.Request)
GetTaskByID returns a single Task document by id Handler for HTTP Get - "/tasks/{id}"
func GetTasks ¶
func GetTasks(w http.ResponseWriter, r *http.Request)
GetTasks returns all Task document Handler for HTTP Get - "/tasks"
func GetTasksByUser ¶
func GetTasksByUser(w http.ResponseWriter, r *http.Request)
GetTasksByUser returns all Tasks created by a User Handler for HTTP Get - "/tasks/users/{id}"
func Login ¶
func Login(w http.ResponseWriter, r *http.Request)
Login authenticates the HTTP request with username and apssword Handler for HTTP Post - "/users/login"
func Register ¶
func Register(w http.ResponseWriter, r *http.Request)
Register add a new User document Handler for HTTP Post - "/users/register"
func UpdateNote ¶
func UpdateNote(w http.ResponseWriter, r *http.Request)
UpdateNote updates an existing Note document Handler for HTTP Put - "/notes/{id}"
func UpdateTask ¶
func UpdateTask(w http.ResponseWriter, r *http.Request)
UpdateTask update an existing Task document Handler for HTTP Put - "/tasks/{id}"
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 User string }
Context used for maintaining HTTP Request Context
func NewContext ¶
func NewContext() *Context
NewContext creates a new Context object for each HTTP request
func (*Context) DbCollection ¶
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