db

package
v0.0.0-...-4d621b9 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2018 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteUserMessage

func DeleteUserMessage(uid int, id int) int64

func SaveNewGroup

func SaveNewGroup(uid int, category string, title string) int64

func SaveNewUser

func SaveNewUser(fullname string, username string, password string) int64

func SaveRecipientNewMessage

func SaveRecipientNewMessage(uid int, msg string) int64

func SaveSenderNewMessage

func SaveSenderNewMessage(uid int, msg string) int64

Types

type Category

type Category struct {
	Id      int     `json:"_id,omitempty"`
	Uid     int     `json:"_uid,omitempty"`
	Did     int     `json:"_did,omitempty"`
	Rid     int     `json:"_rid,omitempty"`
	Title   string  `json:"title,omitempty"`
	Content []Group `json:"content"`
}

func BuildCategory

func BuildCategory(a []Group, b []Category) []Category

func GetAllCategories

func GetAllCategories(uid int) []Category

func GetCategory

func GetCategory(uid int, title string) Category

type DatabaseConnection

type DatabaseConnection struct {
}

func NewDatabaseConnection

func NewDatabaseConnection() *DatabaseConnection

func (*DatabaseConnection) Connect

func (db *DatabaseConnection) Connect() (*sql.DB, error)

type Group

type Group struct {
	Id            int    `json:"_id,omitempty"`
	Uid           int    `json:"_uid,omitempty"`
	Did           int    `json:"_did,omitempty"`
	Rid           int    `json:"_rid,omitempty"`
	Title         string `json:"title"`
	Notifications int    `json:"notifications"`
	Views         []View `json:"views"`
}

func BuildGroup

func BuildGroup(a []View, b []Group) []Group

func GetAllGroups

func GetAllGroups(uid int) []Group

type Message

type Message struct {
	Id       int    `json:"_id,omitempty"`
	Uid      int    `json:"_uid,omitempty"`
	Did      int    `json:"_did,omitempty"`
	Rid      int    `json:"_rid,omitempty"`
	Received string `json:"received,omitempty"`
	Sent     string `json:"sent,omitempty"`
}

func GetAllMessages

func GetAllMessages() []Message

func GetAllMessagesFromUser

func GetAllMessagesFromUser(uid int) []Message

type User

type User struct {
	Id       int        `json:"_id,omitempty"`
	Uid      int        `json:"_uid,omitempty"`
	Did      int        `json:"_did,omitempty"`
	Rid      int        `json:"_rid,omitempty"`
	Fullname string     `json:"fullname,omitempty"`
	Username string     `json:"username,omitempty"`
	Password string     `json:"password,omitempty"`
	Content  []Category `json:"content"`
}

func GetAllUsersFromDatabase

func GetAllUsersFromDatabase() []User

func GetUserFromDatabase

func GetUserFromDatabase(username string) *User

type View

type View struct {
	Id       int       `json:"_id,omitempty"`
	Uid      int       `json:"_uid,omitempty"`
	Did      int       `json:"_did,omitempty"`
	Rid      int       `json:"_rid,omitempty"`
	User     string    `json:"user,omitempty"`
	Username string    `json:"username,omitempty"`
	Body     string    `json:"body,omitempty"`
	Content  []Message `json:"content"`
	Type     string    `json:"_type,omitempty"`
	Status   string    `json:"_status,omitempty"`
}

func BuildView

func BuildView(a []Message, b []View) []View

func GetAllViews

func GetAllViews(uid int) []View

Jump to

Keyboard shortcuts

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