database

package
v0.0.0-...-ceacdd9 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2019 License: AGPL-3.0 Imports: 5 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupDatabase

func SetupDatabase() *gorm.DB

Setup the database by connecting to it and building the schema if it does not already exist

Types

type Message

type Message struct {
	gorm.Model
	Subject   string
	Message   string
	Algorithm uint
	ToID      uint
	FromID    uint
}

Stores a message in a PostgreSQL table

type Token

type Token struct {
	gorm.Model
	SigningKey string
	UserId     uint
	User       User
}

Stores a user authentication token in a PostgreSQL table

type User

type User struct {
	gorm.Model
	Name     string
	Username string
	Password string
	Inbox    []Message `gorm:"foreignkey:ToID"`
	Outbox   []Message `gorm:"foreignkey:FromID"`
}

Stores the user's information in a PostgreSQL table

Jump to

Keyboard shortcuts

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