model

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	ID        uint      `json:"id" gorm:"column:id;primarykey"`
	Name      string    `json:"name" gorm:"column:name;type:varchar(255);not null"`
	CreatedAt time.Time `json:"created_at" gorm:"column:created_at"`
	UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"`
}

func (Category) TableName

func (Category) TableName() string

type Fasting

type Fasting struct {
	ID         uint           `json:"id" gorm:"column:id;primarykey"`
	CategoryID uint           `json:"category_id" gorm:"column:category_id;not null"`
	TypeID     uint           `json:"type_id" gorm:"column:type_id;not null"`
	Date       datatypes.Date `json:"date" gorm:"column:date;not null"`
	Year       uint32         `json:"year" gorm:"column:year;not null"`
	Month      uint32         `json:"month" gorm:"column:month;not null"`
	Day        uint32         `json:"day" gorm:"column:day;not null"`
	CreatedAt  time.Time      `json:"created_at"`
	UpdatedAt  time.Time      `json:"updated_at"`

	Category Category `json:"category" gorm:"foreignKey:CategoryID;references:ID"`
	Type     Type     `json:"type" gorm:"foreignKey:TypeID;references:ID"`
}

func (Fasting) TableName

func (Fasting) TableName() string

type Source

type Source struct {
	ID        uint      `json:"id" gorm:"column:id;primarykey"`
	Url       string    `json:"url" gorm:"column:url;type:text;not null"`
	CreatedAt time.Time `json:"created_at" gorm:"column:created_at"`
	UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"`
}

func (Source) TableName

func (Source) TableName() string

type Type

type Type struct {
	ID          uint      `json:"id" gorm:"column:id;primarykey"`
	Name        string    `json:"name" gorm:"column:name;type:varchar(255);not null"`
	Description string    `json:"description" gorm:"column:description;type:text;not null"`
	CreatedAt   time.Time `json:"created_at" gorm:"column:created_at"`
	UpdatedAt   time.Time `json:"updated_at" gorm:"column:updated_at"`
}

func (Type) TableName

func (Type) TableName() string

Jump to

Keyboard shortcuts

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