Semaphore/db/View.go

17 lines
356 B
Go
Raw Normal View History

2021-10-26 20:19:12 +02:00
package db
import "fmt"
2021-10-26 20:19:12 +02:00
type View struct {
ID int `db:"id" json:"id"`
ProjectID int `db:"project_id" json:"project_id"`
Title string `db:"title" json:"title"`
2021-10-27 18:22:52 +02:00
Position int `db:"position" json:"position"`
2021-10-26 20:19:12 +02:00
}
func (view *View) Validate() error {
if view.Title == "" {
return fmt.Errorf("title can not be empty")
}
return nil
}