Documentation
¶
Index ¶
- func MigrateModels(db *gorm.DB) error
- type Task
- func (t *Task) API() *tasksv1.Task
- func (t *Task) ApplyMask(mask *fieldmaskpb.FieldMask) (map[string]any, error)
- func (t *Task) FromAPI(in *tasksv1.Task)
- func (t *Task) FromJSON(data []byte) error
- func (t *Task) FromYAML(data []byte) error
- func (t *Task) JSON() ([]byte, error)
- func (t *Task) Map() map[string]any
- func (t *Task) YAML() ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigrateModels ¶ added in v0.4.0
MigrateModels migrates the domain models using the given DB connection.
Types ¶
type Task ¶
type Task struct {
gorm.Model
Title string `json:"title" validate:"required,min=3"`
Description string `json:"description"`
Deadline *time.Time `json:"deadline"`
CompletedAt *time.Time `json:"completed_at"`
}
Task defines the scope of an action a User implements in their tasks dashboard.
func (*Task) ApplyMask ¶ added in v0.6.0
ApplyMask returns the Map of the current Task with the given mask applied.
func (*Task) FromJSON ¶ added in v0.4.0
FromJSON converts a slice of bytes in JSON format to a Task.
func (*Task) FromYAML ¶ added in v0.4.0
FromYAML converts a slice of bytes in YAML format to a Task.
Click to show internal directories.
Click to hide internal directories.