Documentation ¶
Index ¶
- Constants
- Variables
- func ChangePassword(userID string, password string) error
- func ChangeUserID(oldUserID, newUserID string) error
- func CreateTask(task Task) error
- func CreateUser(userID string, password string) error
- func DeleteTask(task Task) error
- func DeleteUser(userID string) error
- func DoneTask(task Task) error
- func GetTagsByTaskID(taskID int64) ([]string, error)
- func GetTagsByUserID(userID string) ([]string, error)
- func UpdateTask(task Task, columns int) error
- type Task
- type Tasks
- func GetTasksByFunc(userID string, f func(q *orm.Query) *orm.Query, columns int) (Tasks, error)
- func GetTasksByID(userID string, ids []int64, columns int) (Tasks, error)
- func GetTasksByTag(userID string, tagName string, columns int) (Tasks, error)
- func GetTasksByUserID(userID string, columns int) (Tasks, error)
- type Time
- func (t Time) Date() string
- func (t Time) EqualZero() bool
- func (t Time) Get() int64
- func (t Time) MarshalJSON() ([]byte, error)
- func (t *Time) ParseDateTime(dateStr string, timeStr string) error
- func (t *Time) Scan(val interface{}) error
- func (t *Time) Set(sec int64)
- func (t Time) String() string
- func (t Time) Time() string
- func (t Time) Value() (driver.Value, error)
- type User
Constants ¶
View Source
const ( CTaskUserID = 1 << iota CTaskID CTaskSubject CTaskDue CTaskPriority CTaskReminder CTaskNext CTaskNote CTaskParentTaskID CTaskTags CTaskSubTaskIDs )
Column flag
View Source
const ( DateLayout = "2006-01-02" TimeLayout = "15:04" )
Variables ¶
View Source
var ( ShortColumnNames = map[string]string{ "UserID": "user_id", "ID": "id", "Subject": "subject", "Due": "due", "Priority": "priority", "Reminder": "reminder", "Next": "next", "Note": "note", "ParentTaskID": "parent_task_id", } FullColumnNames = map[string]string{ "UserID": "task.user_id", "ID": "task.id", "Subject": "task.subject", "Due": "task.due", "Priority": "task.priority", "Reminder": "task.reminder", "Next": "task.next", "Note": "task.note", "ParentTaskID": "task.parent_task_id", } )
Column name string
View Source
var DBConn *pg.DB
Functions ¶
func ChangePassword ¶
func ChangeUserID ¶
func CreateTask ¶
func CreateUser ¶
func DeleteTask ¶
func DeleteUser ¶
func GetTagsByTaskID ¶
func GetTagsByUserID ¶
func UpdateTask ¶
Types ¶
type Task ¶
type Tasks ¶
type Tasks []Task
Tasks is a slice of Task.
func GetTasksByFunc ¶
func (Tasks) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
Time is a unix timestamp.
func (Time) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface.
func (*Time) ParseDateTime ¶
ParseDateTime parses date & time string and sets Time.sec. If date is empty, Time.sec = 0. If date is not empty and time is empty, only date will be parsed.
Click to show internal directories.
Click to hide internal directories.