entities

package
v0.0.0-...-80f32cb Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	CreatedAt time.Time `json:"creation" gorm:"default:CURRENT_TIMESTAMP"`
	UpdatedAt time.Time `json:"updated" gorm:"default:CURRENT_TIMESTAMP"`
}

type Farm

type Farm struct {
	Base
	ID          uint64 `json:"id" binding:"required" gorm:"primary_key;auto_increment"`
	URL         string `json:"url" binding:"required,url" gorm:"type:varchar(255);UNIQUE"`
	Name        string `json:"name" binding:"required,min=2,max=50" gorm:"type:varchar(155)"`
	Description string `json:"description" gorm:"type:text"`
	Admin       User   `json:"admin" gorm:"foreignkey:UserEmail"`
	UserEmail   string `json:"-"`
}

type User

type User struct {
	Base
	FirstName string `json:"firstname"`
	LastName  string `json:"lastname"`
	Email     string `json:"email" validate:"required" binding:"email" gorm:"primary_key"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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