database

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: AGPL-3.0 Imports: 2 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category added in v1.0.2

type Category struct {
	ID        int       `json:"id" gorm:"primaryKey"`
	Name      string    `json:"name" gorm:"type:varchar(191)"`
	Order     int       `json:"order" gorm:"type:int"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type Event added in v1.0.4

type Event struct {
	ID          uint            `json:"id"`
	Title       string          `json:"title" gorm:"type:varchar(191)"`
	Description string          `json:"description" gorm:"type:text"`
	Start       time.Time       `json:"start"`
	End         time.Time       `json:"end"`
	BannerID    uint            `json:"-"`
	Banner      File            `json:"banner" gorm:"foreignKey:BannerID"`
	Positions   []EventPosition `json:"positions"`
	SignUps     []EventSignUp   `json:"signups"`
	CreatedAt   time.Time       `json:"created_at"`
	UpdatedAt   time.Time       `json:"updated_at"`
}

type EventPosition added in v1.0.4

type EventPosition struct {
	ID        int64     `json:"id"`
	EventID   int64     `json:"event"`
	Position  int64     `json:"position" gorm:"type:varchar(15)"`
	TakenByID uint      `json:"-"`
	TakenBy   User      `json:"taken_by"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type EventSignUp added in v1.0.4

type EventSignUp struct {
	ID        int64     `json:"id"`
	EventID   int64     `json:"event"`
	UserID    uint      `json:"-"`
	User      User      `json:"user"`
	First     string    `json:"first" gorm:"type:varchar(15)"`
	Second    string    `json:"second" gorm:"type:varchar(15)"`
	Third     string    `json:"third" gorm:"type:varchar(15)"`
	Notes     string    `json:"notes" gorm:"type:text"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type File added in v1.0.2

type File struct {
	ID          uint      `json:"id" gorm:"primaryKey"`
	Name        string    `json:"name" gorm:"type:varchar(191)"`
	Filename    string    `json:"-" gorm:"type:varchar(191)"`
	Bucket      string    `json:"-" gorm:"type:varchar(191)"`
	Key         string    `json:"-" gorm:"type:varchar(191)"`
	ContentType string    `json:"contentType" gorm:"type:varchar(191)"`
	Size        int64     `json:"size" gorm:"type:bigint"`
	Description string    `json:"description" gorm:"type:text"`
	CategoryID  int       `json:"-"`
	Category    Category  `json:"category"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

type Flights

type Flights struct {
	ID          int       `json:"id" gorm:"primaryKey"`
	Callsign    string    `json:"callsign" gorm:"index;type:varchar(10)"`
	CID         int       `json:"cid" gorm:"index;column:cid"`
	Name        string    `json:"name" gorm:"type:varchar(191)"`
	Facility    string    `json:"facility" gorm:"type:varchar(4)"`
	Latitude    float32   `json:"latitude" gorm:"type:float(10,8)"`
	Longitude   float32   `json:"longitude" gorm:"type:float(11,8)"`
	Groundspeed int       `json:"groundspeed"`
	Heading     int       `json:"heading"`
	Altitude    int       `json:"altitude"`
	Aircraft    string    `json:"aircraft" gorm:"type:varchar(10)"`
	Departure   string    `json:"departure" gorm:"type:varchar(4)"`
	Arrival     string    `json:"arrival" gorm:"type:varchar(4)"`
	Route       string    `json:"route" gorm:"type:text"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

type OAuthClient

type OAuthClient struct {
	ID           uint   `json:"id" gorm:"primaryKey"`
	Name         string `json:"name" gorm:"primaryKey"`
	ClientId     string `json:"client_id" gorm:"type:varchar(128)"`
	ClientSecret string `json:"-" gorm:"type:varchar(255)"`
	RedirectURIs string `json:"return_uris" gorm:"type:text"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

func (OAuthClient) TableName

func (OAuthClient) TableName() string

func (*OAuthClient) ValidURI

func (c *OAuthClient) ValidURI(uri string) (bool, error)

type OAuthLogin

type OAuthLogin struct {
	ID                  uint        `json:"id" gorm:"primaryKey"`
	Token               string      `json:"token" gorm:"type:varchar(128)"`
	Code                string      `json:"code" gorm:"varchar(48)"`
	UserAgent           string      `json:"ua" gorm:"type:varchar(255)"`
	RedirectURI         string      `json:"url" gorm:"type:varchar(255)"`
	ClientID            uint        `json:"-"`
	Client              OAuthClient `json:"-"`
	State               string      `json:"state"`
	CodeChallenge       string      `json:"-"`
	CodeChallengeMethod string      `json:"-"`
	Scope               string      `json:"-"`
	CID                 uint        `json:"cid"`
	Name                string      `json:"name"`
	Roles               string      `json:"roles"`
	CreatedAt           time.Time
	UpdatedAt           time.Time
}

func (OAuthLogin) TableName

func (OAuthLogin) TableName() string

type OnlineControllers

type OnlineControllers struct {
	ID        int       `json:"id" gorm:"primaryKey"`
	Callsign  string    `json:"callsign" gorm:"index;type:varchar(10)"`
	CID       int       `json:"cid" gorm:"index;column:cid"`
	Name      string    `json:"name" gorm:"type:varchar(191)"`
	Facility  string    `json:"facility" gorm:"type:varchar(4)"`
	Position  string    `json:"position" gorm:"type:varchar(10)"`
	Frequency string    `json:"frequency" gorm:"type:varchar(7)"`
	LogonTime time.Time `json:"logon_time"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type Rating

type Rating struct {
	ID    int    `json:"id" gorm:"type:int(3)"`
	Long  string `json:"long" gorm:"type:varchar(25)"`
	Short string `json:"short" gorm:"type:varchar(3)"`
}

type Role

type Role struct {
	ID        int       `json:"id" gorm:"primaryKey"`
	Name      string    `json:"name" gorm:"type:varchar(64);index"`
	Users     []*User   `json:"users" gorm:"many2many:user_roles"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type Tabler

type Tabler interface {
	TableName() string
}

type User

type User struct {
	CID               uint      `json:"cid" gorm:"primaryKey;type:int(11);column:cid"`
	FirstName         string    `json:"firstname" gorm:"type:varchar(128)"`
	LastName          string    `json:"lastname" gorm:"type:varchar(128)"`
	Email             string    `json:"-" yaml:"-" xml:"-" gorm:"type:varchar(128);index"`
	ControllerType    string    `json:"controllerType" gorm:"type:enum('none', 'visitor', 'home');not null;default:'none'"`
	OperatingInitials string    `json:"operatingInitials" gorm:"type:char(2);index"`
	RatingID          int       `json:"-" yaml:"-" xml:"-"`
	Rating            Rating    `json:"rating"`
	Roles             []*Role   `json:"roles" gorm:"many2many:user_roles"`
	Status            string    `json:"status" gorm:"type:enum('none', 'active', 'inactive', 'leave', 'removed');not null;default:'none'"`
	Delivery          string    `json:"delivery" gorm:"type:enum('none','minor','major-solo','certified');not null;default:'none'"`
	Ground            string    `json:"ground" gorm:"type:enum('none','minor','major-solo','certified');not null;default:'none'"`
	Local             string    `json:"local" gorm:"type:enum('none','minor','major-solo','certified');not null;default:'none'"`
	Approach          string    `json:"approach" gorm:"type:enum('none','minor','major-solo','certified');not null;default:'none'"`
	Enroute           string    `json:"enroute" gorm:"type:enum('none','major-solo','certified');not null;default:'none'"`
	UpdateId          string    `json:"updateId" gorm:"type:varchar(21)"`
	CreatedAt         time.Time `json:"created_at"`
	UpdatedAt         time.Time `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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