Documentation ¶
Index ¶
- type DB
- func (db *DB) CreateAccount(a *models.Account) error
- func (db *DB) CreateAllSettings(a *models.Account) error
- func (db *DB) CreateEvent(ce *models.CalendarEvent, accountID int) error
- func (db *DB) CreateRefreshToken(te *models.AccountToken) error
- func (db *DB) CreateTask(ct *models.CalendarTask, accountID int) error
- func (db *DB) DeleteEvent(ce *models.CalendarEvent, accountID int) error
- func (db *DB) DeleteEventsWithTaskId(ct *models.CalendarTask, accountID int) error
- func (db *DB) DeleteRefreshToken(te *models.AccountToken) error
- func (db *DB) DeleteTask(ct *models.CalendarTask, accountID int) error
- func (db *DB) EmailExists(email string) bool
- func (db *DB) GetAccount(a *models.Account) error
- func (db *DB) GetEvent(ce *models.CalendarEvent, accountID int) error
- func (db *DB) GetEvents(accountID, start, amount int, category string) ([]models.CalendarEvent, error)
- func (db *DB) GetEventsByTaskId(accountID, taskID int) ([]models.CalendarEvent, error)
- func (db *DB) GetEventsInInterval(accountID int, from, to time.Time, excludeTask int) ([]models.CalendarEvent, error)
- func (db *DB) GetSettingValue(a *models.Account, key string) (string, error)
- func (db *DB) GetSettings(a *models.Account) error
- func (db *DB) GetTask(ct *models.CalendarTask, accountID int) error
- func (db *DB) GetTasks(accountID, start, amount int, category string) ([]models.CalendarTask, error)
- func (db *DB) RefreshTokenExists(refreshToken string) bool
- func (db *DB) UpdateEvent(ce *models.CalendarEvent, accountID int) error
- func (db *DB) UpdateSettingValue(a *models.Account, key string, value interface{}) error
- func (db *DB) UpdateTask(ct *models.CalendarTask, accountID int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
func (*DB) CreateAccount ¶
CreateAccount creates a user account
func (*DB) CreateAllSettings ¶
CreateAllSettings updates the entire settings column for one user
func (*DB) CreateEvent ¶
func (db *DB) CreateEvent(ce *models.CalendarEvent, accountID int) error
CreateEvent creates a calendar event
func (*DB) CreateRefreshToken ¶
func (db *DB) CreateRefreshToken(te *models.AccountToken) error
CreateRefreshToken creates a user refresh token
func (*DB) CreateTask ¶
func (db *DB) CreateTask(ct *models.CalendarTask, accountID int) error
CreateTask creates a calendar task
func (*DB) DeleteEvent ¶
func (db *DB) DeleteEvent(ce *models.CalendarEvent, accountID int) error
DeleteEvent deletes a calendar event by id
func (*DB) DeleteEventsWithTaskId ¶
func (db *DB) DeleteEventsWithTaskId(ct *models.CalendarTask, accountID int) error
DeleteEventsWithTaskId deletes all events with the supplied task id
func (*DB) DeleteRefreshToken ¶
func (db *DB) DeleteRefreshToken(te *models.AccountToken) error
DeleteRefreshToken deletes a user refresh token
func (*DB) DeleteTask ¶
func (db *DB) DeleteTask(ct *models.CalendarTask, accountID int) error
DeleteTask deletes a calendar task by its id
func (*DB) EmailExists ¶
EmailExists checks if an email exists
func (*DB) GetAccount ¶
GetAccount fetches a user account by email
func (*DB) GetEvent ¶
func (db *DB) GetEvent(ce *models.CalendarEvent, accountID int) error
GetEvent fetches a calendar event by id
func (*DB) GetEvents ¶
func (db *DB) GetEvents(accountID, start, amount int, category string) ([]models.CalendarEvent, error)
GetEvents fetches a specified amount of events with an optional category
func (*DB) GetEventsByTaskId ¶
func (db *DB) GetEventsByTaskId(accountID, taskID int) ([]models.CalendarEvent, error)
GetEventsByTaskId fetches all events with the supplied task id
func (*DB) GetEventsInInterval ¶
func (db *DB) GetEventsInInterval(accountID int, from, to time.Time, excludeTask int) ([]models.CalendarEvent, error)
GetEventsInInterval fetches all calendar events between dates from and to. Optionally exclude a task id, call with 0 as excludeTask to not exclude anything.
func (*DB) GetSettingValue ¶
GetSettingValue gets a user setting using the setting key. The key has to be in the form of "$.<key>", for example "$.preferred_date"
func (*DB) GetSettings ¶
GetSettings gets all settings for a user
func (*DB) GetTask ¶
func (db *DB) GetTask(ct *models.CalendarTask, accountID int) error
GetTask fetches a calendar task by its id
func (*DB) GetTasks ¶
func (db *DB) GetTasks(accountID, start, amount int, category string) ([]models.CalendarTask, error)
GetTasks fetches the specified amount of calendar tasks
func (*DB) RefreshTokenExists ¶
RefreshTokenExists checks if a refresh token exists
func (*DB) UpdateEvent ¶
func (db *DB) UpdateEvent(ce *models.CalendarEvent, accountID int) error
UpdateEvent updates a calendar event by id
func (*DB) UpdateSettingValue ¶
UpdateSettingValue updates a user setting using the setting key. The key has to be in the form of "$.<key>", for example "$.preferred_date"
func (*DB) UpdateTask ¶
func (db *DB) UpdateTask(ct *models.CalendarTask, accountID int) error
UpdateTask updates a calendar task by its id