Documentation ¶
Overview ¶
Package model defines data models used in the app
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateTimer ¶
ValidateTimer validates the given value of Timer.
func ValidateTimerCore ¶
ValidateTimerCore validates the given value of TimerCore.
Types ¶
type Model ¶
type Model struct { ID uint `json:"-" gorm:"primarykey"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"-"` }
Model is the slightly-updated version of gorm.Model It will be managed automatically by gorm.
type Timer ¶
type Timer struct { Model TimerCore Alive bool `json:"-" gorm:"index:uniq_name_alive,unique,priority:2"` DeletedAt gorm.DeletedAt `json:"-"` }
Timer is the data model for RESTful resource timer.
type TimerCore ¶
type TimerCore struct { Name string `json:"name" gorm:"index:uniq_name_alive,unique,priority:1" validate:"required,notblank"` TriggerAt time.Time `json:"triggerAt" gorm:"index:idx_trigger_at" validate:"required,gte=time.Now().Add(time.Minute),notblank"` }
TimerCore contains fields that can be specified directly via APIs.
Click to show internal directories.
Click to hide internal directories.