domain

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateModels

func MigrateModels(db *gorm.DB) error

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) API

func (t *Task) API() *tasksv1.Task

API converts this Task to a tasksv1.Task.

func (*Task) ApplyMask

func (t *Task) ApplyMask(mask *fieldmaskpb.FieldMask) (map[string]any, error)

ApplyMask returns the Map of the current Task with the given mask applied.

func (*Task) FromAPI

func (t *Task) FromAPI(in *tasksv1.Task)

FromAPI fills this Task with the data from tasksv1.Task.

func (*Task) FromJSON

func (t *Task) FromJSON(data []byte) error

FromJSON converts a slice of bytes in JSON format to a Task.

func (*Task) FromYAML

func (t *Task) FromYAML(data []byte) error

FromYAML converts a slice of bytes in YAML format to a Task.

func (*Task) JSON

func (t *Task) JSON() ([]byte, error)

JSON converts this Task to a slice of bytes in JSON format.

func (*Task) YAML

func (t *Task) YAML() ([]byte, error)

YAML converts this Task to a slice of bytes in YAML format.

Jump to

Keyboard shortcuts

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