Documentation ¶
Index ¶
- Constants
- Variables
- type AccessToken
- type Device
- type DeviceOptions
- type Friendship
- type Message
- type ReceivedMessage
- func FindReceivedMessage(DB *sql.DB, id uint) (ReceivedMessage, error)
- func FindReceivedMessageByMessage(DB *sql.DB, msgID uint) (ReceivedMessage, error)
- func FindReceivedMessagesByDevice(DB *sql.DB, deviceID string) ([]ReceivedMessage, error)
- func FindUnreadReceivedMessagesByDevice(DB *sql.DB, deviceID string) ([]ReceivedMessage, error)
- func FindUnreadReceivedMessagesByUser(DB *sql.DB, userID uint) ([]ReceivedMessage, error)
- type User
Constants ¶
View Source
const ( ContentTypeMessage = iota ContentTypeURL = iota ContentTypeFile = iota ContentTypeLast = iota )
Variables ¶
View Source
var DevicePlatforms map[string]bool = map[string]bool{ "chrome": true, "firefox": true, "android": true, }
Use a map so that we can check for existence without iterating over an array
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
func FindAccessToken ¶
func FindAccessToken(DB *sql.DB, token string) (AccessToken, error)
type Device ¶
type DeviceOptions ¶
func (*DeviceOptions) ParseJSONMap ¶
func (d *DeviceOptions) ParseJSONMap(json map[string]interface{}) error
type Friendship ¶
type Message ¶
type Message struct { ID uint CreatedAt time.Time LastModifiedAt time.Time UserID uint DeviceID string ContentType uint Title string Msg string URL string File string }
func FindMessagesByDevice ¶
type ReceivedMessage ¶
type ReceivedMessage struct { ID uint CreatedAt time.Time DeviceID string MessageID uint Unread bool }
func FindReceivedMessage ¶
func FindReceivedMessage(DB *sql.DB, id uint) (ReceivedMessage, error)
func FindReceivedMessageByMessage ¶
func FindReceivedMessageByMessage(DB *sql.DB, msgID uint) (ReceivedMessage, error)
func FindReceivedMessagesByDevice ¶
func FindReceivedMessagesByDevice(DB *sql.DB, deviceID string) ([]ReceivedMessage, error)
func FindUnreadReceivedMessagesByDevice ¶
func FindUnreadReceivedMessagesByDevice(DB *sql.DB, deviceID string) ([]ReceivedMessage, error)
func FindUnreadReceivedMessagesByUser ¶
func FindUnreadReceivedMessagesByUser(DB *sql.DB, userID uint) ([]ReceivedMessage, error)
type User ¶
type User struct { ID uint CreatedAt time.Time LastModifiedAt time.Time LastSignInAt time.Time Username string FirstName string LastName string Email string EmailConfirmed bool Password string Devices []Device Tokens []AccessToken Messages []Message Friends []Friendship FriendOf []Friendship }
func (*User) ComparePassword ¶
func (*User) FriendsWith ¶
func (*User) SetPassword ¶
Click to show internal directories.
Click to hide internal directories.