model

package
v0.0.0-...-dd0ccd7 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: MIT Imports: 3 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        string    `gorm:"primaryKey" json:"id"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
	Text      string    `json:"text"`
	Completed bool      `json:"completed"`
}

func (Todo) MarshalJSON

func (p Todo) MarshalJSON() ([]byte, error)

func (*Todo) UnmarshalJSON

func (t *Todo) UnmarshalJSON(data []byte) error

type TodoRepository

type TodoRepository interface {
	Add(context.Context, *Todo) error
	Delete(context.Context, string) error
	Update(context.Context, *Todo) error
	List(context.Context) (res []*Todo, err error)
	Get(context.Context, string) (res *Todo, err error)
}

type TodoReq

type TodoReq struct {
	Text      *string `json:"text"`
	Completed *bool   `json:"completed"`
}

type TodoRes

type TodoRes Todo

Jump to

Keyboard shortcuts

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