models

package
v0.0.0-...-385be9b Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Todo

type Todo struct {
	ID        uuid.UUID `db:"id" json:"id" validate:"required,uuid4"`
	CreatedAt time.Time `db:"created_at" json:"created_at"`
	UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
	UserID    uuid.UUID `db:"user_id" json:"user_id" validate:"required,uuid4"`
	Content   string    `db:"content" json:"content" validate:"required,lte=255"`
	Complete  bool      `db:"complete" json:"complete"`
	TodoAttrs TodoAttrs `db:"todo_attrs" json:"todo_attrs" validate:"required,dive"`
}

Todo struct to describe todo object

type TodoAttrs

type TodoAttrs struct {
	Color string `json:"color"`
}

TodoAttrs struct to describe todo attributes

func (*TodoAttrs) Scan

func (t *TodoAttrs) Scan(value interface{}) error

Scan make the TodoAttrs struct implement the sql.Scanner interface. This method decodes a JSON-encoded value into the struct fields.

func (TodoAttrs) Value

func (t TodoAttrs) Value() (driver.Value, error)

Value make the TodoAttrs struct implement the driver.Value interface. This method simples returns the JSON-encoded representation of the struct.

Jump to

Keyboard shortcuts

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