models

package
v0.0.0-...-485f18f Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cart

type Cart struct {
	gorm.Model
	// contains filtered or unexported fields
}

type Exhibit

type Exhibit interface {
	Place() uint
}

type Group

type Group struct {
	gorm.Model
	Name     string
	Exhibits []Exhibit `gorm:"-"` // Ignored by GORM and constructed by query
}

type Image

type Image struct {
	gorm.Model
	ItemID uint   `gorm:"unique_index:idx_image_order"`
	Order  int    `gorm:"unique_index:idx_image_order"`
	Path   string // Relative path to the image file
}

type Item

type Item struct {
	gorm.Model
	Name         string
	Description  string
	Price        float64
	Images       []Image
	Availability uint
	Begin        time.Time
	End          time.Time
}

type OrderedGroup

type OrderedGroup struct {
	gorm.Model
	ParentID uint  // The ID of its parent Group
	Parent   Group `gorm:"AssociationForeignKey:ParentID;unique_index:idx_group_order"`
	RefID    uint  // The ID of its representing Group
	Ref      Group `gorm:"AssociationForeignKey:RefID"`
	Order    uint  `gorm:"unique_index:idx_group_order"`
}

func (OrderedGroup) Place

func (g OrderedGroup) Place() uint

type OrderedItem

type OrderedItem struct {
	gorm.Model
	ParentID uint  // The ID of its parent Group
	Parent   Group `gorm:"AssociationForeignKey:ParentID;unique_index:idx_item_order"`
	RefID    uint  // The ID of its representing Group
	Ref      Item  `gorm:"AssociationForeignKey:RefID"`
	Order    uint  `gorm:"unique_index:idx_item_order"`
}

func (OrderedItem) Place

func (i OrderedItem) Place() uint

Jump to

Keyboard shortcuts

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