Documentation ¶ Index ¶ func RespondJSON(ctx context.Context, w http.ResponseWriter, body any, status int) type AddTask func (at *AddTask) ServeHTTP(w http.ResponseWriter, r *http.Request) type ErrResponse type ListTask func (lt *ListTask) ServeHTTP(w http.ResponseWriter, r *http.Request) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func RespondJSON ¶ func RespondJSON(ctx context.Context, w http.ResponseWriter, body any, status int) any = interface{} Types ¶ type AddTask ¶ type AddTask struct { Store *store.TaskStore Validator *validator.Validate } タスク操作をする store.TaskStore をラップしてハンドラを定義 func (*AddTask) ServeHTTP ¶ func (at *AddTask) ServeHTTP(w http.ResponseWriter, r *http.Request) type ErrResponse ¶ type ErrResponse struct { Message string `json:"message"` Details []string `json:"details,omitempty"` } type ListTask ¶ type ListTask struct { Store *store.TaskStore } タスク操作をする store.TaskStore をラップしてハンドラを定義 func (*ListTask) ServeHTTP ¶ func (lt *ListTask) ServeHTTP(w http.ResponseWriter, r *http.Request) Source Files ¶ View all Source files add_task.gohelper.golist_task.go Click to show internal directories. Click to hide internal directories.