database

package
v0.0.0-...-7e76170 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2015 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Db gorm.DB
)

Functions

func Create

func Create()

func Init

func Init()

func Migrate

func Migrate()

Types

type History

type History struct {
	ID        int
	Time      time.Time
	Queue     Queue
	User      User
	Operation Operation
}

type Member

type Member struct {
	ID               int
	SubscriptionTime time.Time
	QueueID          int  `sql:"unique_index:queue_user"` // Foreign Key
	User             User // One2One
	UserID           int  `sql:"unique_index:queue_user"`
}

type Operation

type Operation int
const (
	Added Operation = iota
	Exited
	MarkedAsCurrent
	MarkedAsFinished
)

type Queue

type Queue struct {
	ID              int
	Title           string `sql:"type:varchar(255)"`
	Description     string `sql:"type:varchar(255)"`
	MaxPeoples      int
	Creator         User   // One2One
	CreatorID       int    `json:"-"`
	CurrentMember   Member // One2One
	CurrentMemberID int    `json:"-"`
	Members         []Member
	Created         time.Time
	IsActive        bool
	IsDeleted       bool
}

type User

type User struct {
	ID           int
	Email        string `sql:"type:varchar(255);unique_index"`
	FirstName    string `sql:"type:varchar(65)"`
	LastName     string `sql:"type:varchar(65)"`
	Password     string `sql:"type:varchar(255)" json:"-"`
	IsSuperAdmin bool
}

Jump to

Keyboard shortcuts

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