Documentation ¶
Index ¶
- Constants
- Variables
- type ApiError
- type ApiListData
- type ApiMessage
- type ApiShowLists
- type ApiShowSubtasks
- type ApiShowTasks
- type ApiSubtaskData
- type ApiTaskData
- type FileUnit
- type ListEditData
- type Lists
- type ListsData
- type Mail
- type ShowUserData
- type SubtaskEditData
- type SubtasksData
- type TaskEditData
- type Tasks
- type TasksData
- type UserData
- type UserEmail
- type UserLoginData
- type UserName
- type UserPassword
- type UserTokens
- type UserUsername
- type Users
Constants ¶
View Source
const ( MAX_ICON_UPLOAD_SIZE = 5 << 20 // 5MB ACCESS_TOKEN_LIVE = 15 * time.Minute // 15 minutes REFRESH_TOKEN_LIVE = 30 * 24 * time.Hour // 30 days )
View Source
const ( // Select SqlSelectUserById = `SELECT * FROM "users" WHERE id = $1 LIMIT 1` SqlSelectUserByEmail = `SELECT * FROM "users" WHERE email = $1 LIMIT 1` SqlSelectAllUsersById = `SELECT * FROM "users" WHERE id = $1 ORDER BY "users"."id"` SqlSelectAllUsersByEmail = `SELECT * FROM "users" WHERE email = $1 ORDER BY "users"."id"` SqlSelectAllUsersByUsername = `SELECT * FROM "users" WHERE username = $1 ORDER BY "users"."id"` SqlSelectListById = `SELECT * FROM "lists" WHERE id = $1 LIMIT 1` SqlSelectListByIdAndUserId = `SELECT * FROM "lists" WHERE id = $1 AND user_id = $2 LIMIT 1` SqlSelectAllListsByUserId = `SELECT * FROM "lists" WHERE user_id = $1 ORDER BY index` SqlSelectAllListsForEditIndex = `SELECT * FROM "lists" WHERE user_id = $1 AND index > $2` SqlSelectMaxListIndex = `SELECT max(index) FROM "lists" WHERE user_id = $1 LIMIT 1` SqlSelectAllListsToIncreaseTheIndex = `SELECT * FROM "lists" WHERE user_id = $1 AND index <= $2 AND index > $3` SqlSelectAllListsForIndexReduction = `SELECT * FROM "lists" WHERE user_id = $1 AND index >= $2 AND index < $3` SqlSelectTaskById = `SELECT * FROM "tasks" WHERE id = $1 LIMIT 1` SqlSelectAllTasksByListId = `SELECT * FROM "tasks" WHERE list_id = $1 ORDER BY index` SqlSelectAllTasksForEditIndex = `SELECT * FROM "tasks" WHERE list_id = $1 AND index > $2` SqlSelectMaxTaskIndex = `SELECT max(index) FROM "tasks" WHERE list_id = $1 LIMIT 1` SqlSelectAllTasksToIncreaseTheIndex = `SELECT * FROM "tasks" WHERE list_id = $1 AND index <= $2 AND index > $3` SqlSelectAllTasksForIndexReduction = `SELECT * FROM "tasks" WHERE list_id = $1 AND index >= $2 AND index < $3` SqlSelectAllSubtasksByTaskId = `SELECT * FROM "tasks" WHERE task_id = $1 ORDER BY index` SqlSelectTaskIdBySubtaskId = `SELECT task_id FROM "tasks" WHERE id = $1 LIMIT 1` SqlSelectMaxSubtaskIndex = `SELECT max(index) FROM "tasks" WHERE task_id = $1 LIMIT 1` SqlSelectAllSubtasksForEditIndex = `SELECT * FROM "tasks" WHERE task_id = $1 AND index > $2` SqlSelectAllSubtasksToIncreaseTheIndex = `SELECT * FROM "tasks" WHERE task_id = $1 AND index <= $2 AND index > $3` SqlSelectAllSubtasksForIndexReduction = `SELECT * FROM "tasks" WHERE task_id = $1 AND index >= $2 AND index < $3` // Select with join SqlSelectListIdWhereTask = `SELECT lists.id FROM "lists" INNER JOIN tasks ON lists.id=tasks.list_id WHERE user_id = $1 AND tasks.id = $2 LIMIT 1` // Insert SqlInsertUserData = `INSERT INTO "users" ("email","password","name","username","icon","id") VALUES ($1,$2,$3,$4,$5,$6) RETURNING "id"` SqlInsertListData = `INSERT INTO "lists" ("user_id","name","comment","index","id") VALUES ($1,$2,$3,$4,$5) RETURNING "id"` SqlInsertTaskData = `` /* 167-byte string literal not displayed */ // Delete SqlDeleteUser = `DELETE FROM "users" WHERE "users"."id" = $1` SqlDeleteList = `DELETE FROM "lists" WHERE "lists"."id" = $1` SqlDeleteTask = `DELETE FROM "tasks" WHERE "tasks"."id" = $1` // Edit SqlEditUserName = `UPDATE "users" SET "name"=$1 WHERE "users"."id" = $2` SqlEditUserIcon = `UPDATE "users" SET "icon"=$1 WHERE id = $2` SqlEditUserEmail = `UPDATE "users" SET "email"=$1 WHERE "users"."id" = $2` SqlEditUserUsername = `UPDATE "users" SET "username"=$1 WHERE "users"."id" = $2` SqlEditUserPassword = `UPDATE "users" SET "password"=$1 WHERE email = $2` SqlEditList = `UPDATE "lists" SET "name"=$1,"comment"=$2 WHERE "id" = $3` SqlEditListIndex = `UPDATE "lists" SET "index"=$1 WHERE id = $2` SqlEditTask = `UPDATE "tasks" SET "name"=$1,"comment"=$2,"categories"=$3,"end_time"=$4,"done"=$5,"special"=$6 WHERE "id" = $7` SqlEditTaskIndex = `UPDATE "tasks" SET "index"=$1 WHERE id = $2` )
View Source
const BucketName = "user-icons"
Variables ¶
View Source
var (
IMAGE_TYPES = map[string]interface{}{
"image/jpeg": ".jpeg",
"image/png": ".png",
}
)
Functions ¶
This section is empty.
Types ¶
type ApiListData ¶
type ApiMessage ¶
type ApiMessage struct {
Message string `json:"message"`
}
type ApiShowLists ¶
type ApiShowLists struct {
Lists []ListsData `json:"lists"`
}
type ApiShowSubtasks ¶
type ApiShowSubtasks struct {
Subtasks []SubtasksData `json:"subtasks"`
}
type ApiShowTasks ¶
type ApiShowTasks struct {
Tasks []TasksData `json:"tasks"`
}
type ApiSubtaskData ¶
type ApiTaskData ¶
type ListEditData ¶
type ShowUserData ¶
type SubtaskEditData ¶
type SubtaskEditData struct { Id int `json:"id" example:"1023456789"` Name string `json:"name" example:"Pepsi"` Comment string `json:"comment" example:"Sugar-free"` Index int `json:"index" example:"1"` Categories pq.StringArray `gorm:"type:text[]" json:"categories" example:"Party,Shoping,Today"` EndTime string `json:"end_time" example:"2077-12-10 13:13"` Done bool `json:"done" example:"true"` Special bool `json:"special" example:"true"` }
type SubtasksData ¶
type SubtasksData struct { Id int `json:"id" example:"1023456789"` Name string `json:"name" example:"Coca-Cola"` Comment string `json:"comment" example:"Sugar-free"` Index int `json:"index" example:"0"` Categories pq.StringArray `gorm:"type:text[]" json:"categories" example:"Party,Shoping"` EndTime string `json:"end_time" example:"2077-12-10 13:13"` Done bool `json:"done"` Special bool `json:"special"` }
type TaskEditData ¶
type TaskEditData struct { Id int `json:"id" example:"1023456789"` Name string `json:"name" example:"Buy new drinks"` Comment string `json:"comment" example:"Go to the supermarket on the way home"` Index int `json:"index" example:"1"` Categories pq.StringArray `gorm:"type:text[]" json:"categories" example:"Party,Shoping,Today"` EndTime string `json:"end_time" example:"2077-12-10 13:13"` Done bool `json:"done" example:"true"` Special bool `json:"special" example:"true"` }
type TasksData ¶
type TasksData struct { Id int `json:"id" example:"1023456789"` Name string `json:"name" example:"Buy drinks"` Comment string `json:"comment" example:"Go to the supermarket on the way home"` Index int `json:"index" example:"0"` Categories pq.StringArray `gorm:"type:text[]" json:"categories" example:"Party,Shoping"` EndTime string `json:"end_time" example:"2077-12-10 13:13"` Done bool `json:"done"` Special bool `json:"special"` }
type UserLoginData ¶
type UserPassword ¶
type UserPassword struct {
Password string `json:"password" example:"StRon9Pa$$w0rd"`
}
type UserTokens ¶
type UserUsername ¶
type UserUsername struct {
Username string `json:"username" example:"nktkln"`
}
Click to show internal directories.
Click to hide internal directories.