Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // TodoURLPrefix to be returned when encoding todo. TodoURLPrefix = os.Getenv("URL") + "todos/" // ErrTodoTitleBlank validation error. ErrTodoTitleBlank = errors.New("Title can't be blank") )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service interface { Search(ctx context.Context, todos *[]Todo, filter Filter) error Create(ctx context.Context, todo *Todo) error Update(ctx context.Context, todo *Todo, changes rel.Changeset) error Delete(ctx context.Context, todo *Todo) Clear(ctx context.Context) }
Service instance for todo's domain. Any operation done to any of object within this domain should use this service.
type Todo ¶
type Todo struct { ID uint `json:"id"` Title string `json:"title"` Order int `json:"order"` Completed bool `json:"completed"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
Todo respresent a record stored in todos table.
func (Todo) MarshalJSON ¶
MarshalJSON implement custom marshaller to marshal url.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.