Defining the To-Do API
To start your to-do tracking tool, you’ll implement some business logic and an API to deal with to-do items.
In this version of the API, you’ll implement two new custom types:
- item:
-
This type represents a single to-do item. You’ll implement this type using a Go struct. A struct is a custom Go type composed of one or more named elements, or fields. Each field consists of a name and a type, each representing a property of the struct. You can find more information about Go structs in the official documentation.[13] This type won’t be exported, so it can’t be used by API users directly.
- List:
-
This type represents a list of to-do items. It’s implemented by a slice of instances of the type item. This type is exported and visible ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access