models

package
v0.0.0-...-2bdd938 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTaskModel

func NewTaskModel(db *gorm.DB) *taskModel

Types

type Task

type Task struct {
	ID          uint       `json:"id"`
	CreatedAt   time.Time  `json:"createdAt"`
	UpdatedAt   time.Time  `json:"updatedAt"`
	DeletedAt   *time.Time `json:"-"`
	Description string     `json:"description"`
	Completed   bool       `json:"completed"`
}

func (Task) Validate

func (t Task) Validate() error

type TaskModelInterface

type TaskModelInterface interface {
	FindAll() ([]Task, error)
	FindByID(id int) (*Task, error)
	Save(model *Task) error
	Update(model *Task) error
	Delete(model *Task) error
}

Jump to

Keyboard shortcuts

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