db

package
v0.0.0-...-83de54c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertUser

func InsertUser(u User)

func UpdateLastAlert

func UpdateLastAlert(telegram_id string, timestamp string)

func UpdateLastCheck

func UpdateLastCheck(telegram_id string, timestamp string)

func UpdateLastReminder

func UpdateLastReminder(telegram_id string, timestamp string)

func UpdateSettings

func UpdateSettings(telegram_id string, s Settings)

func UpdateUserAccounts

func UpdateUserAccounts(telegram_id string, accounts []string)

func UpdateUserEditing

func UpdateUserEditing(telegram_id string, editing bool, adding bool)

Types

type Alert

type Alert struct {
	Setting   string      `json:"setting"`
	Snooze    string      `json:"snooze"`
	MessageID json.Number `json:"message_id, Number"`
}

type Notification

type Notification struct {
	Setting   string      `json:"setting"`
	MessageID json.Number `json:"message_id, Number"`
}

type Reminder

type Reminder struct {
	Setting   string      `json:"setting"`
	MessageID json.Number `json:"message_id, Number"`
}

type Settings

type Settings struct {
	Notification Notification `json:"notification"`
	Alert        Alert        `json:"alert"`
	Reminder     Reminder     `json:"reminder"`
}

func (*Settings) Scan

func (s *Settings) Scan(src interface{}) error

type User

type User struct {
	ID           int            `json:"id, Number"`
	TelegramID   string         `json:"telegram_id"`
	Accounts     pq.StringArray `json:"accounts"`
	Editing      bool           `json:"editing"`
	Adding       bool           `json:"adding"`
	LastCheck    string         `json:"last_check"`
	Settings     Settings       `json:"settings"`
	LastAlert    string         `json:"last_alert"`
	LastReminder string         `json:"last_reminder"`
}

func GetActiveUsers

func GetActiveUsers(notify_stop string, alert_stop string, remind_stop string) ([]User, error)

func GetUser

func GetUser(telegram_id string) (User, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL