MCPcopy Index your code
hub / github.com/dnote/dnote / DeleteBook

Function DeleteBook

pkg/cli/client/client.go:385–398  ·  view source on GitHub ↗

DeleteBook deletes a book in the server

(ctx context.DnoteCtx, uuid string)

Source from the content-addressed store, hash-verified

383
384// DeleteBook deletes a book in the server
385func DeleteBook(ctx context.DnoteCtx, uuid string) (DeleteBookResp, error) {
386 endpoint := fmt.Sprintf("/v3/books/%s", uuid)
387 res, err := doAuthorizedReq(ctx, "DELETE", endpoint, "", nil)
388 if err != nil {
389 return DeleteBookResp{}, errors.Wrap(err, "deleting a book in the server")
390 }
391
392 var resp DeleteBookResp
393 if err := json.NewDecoder(res.Body).Decode(&resp); err != nil {
394 return resp, errors.Wrap(err, "decoding the response")
395 }
396
397 return resp, nil
398}
399
400// CreateNotePayload is a payload for creating a note
401type CreateNotePayload struct {

Callers 1

sendBooksFunction · 0.92

Calls 1

doAuthorizedReqFunction · 0.85

Tested by

no test coverage detected