database

package
v0.0.0-...-14137fd Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *pg.DB
View Source
var Models = []interface{}{
	&User{},
	&Sheet{},
	&Segment{},
}

All database models

Functions

func Database

func Database() *pg.DB

func Init

func Init()

Initialize the database connection and set up migrations, if necessary.

Types

type Segment

type Segment struct {
	ID        int
	SheetID   int
	Label     string
	Content   string
	CreatedAt string
}

type Sheet

type Sheet struct {
	ID        int
	UserID    int
	Name      string
	CreatedAt string
	Segments  []*Segment
}

type User

type User struct {
	ID       int
	Username string
	Password []uint8
	Sheets   []*Sheet
}

Jump to

Keyboard shortcuts

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