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

Function GetBooks

pkg/cli/client/client.go:522–534  ·  view source on GitHub ↗

GetBooks gets books from the server

(ctx context.DnoteCtx, sessionKey string)

Source from the content-addressed store, hash-verified

520
521// GetBooks gets books from the server
522func GetBooks(ctx context.DnoteCtx, sessionKey string) (GetBooksResp, error) {
523 res, err := doAuthorizedReq(ctx, "GET", "/v3/books", "", nil)
524 if err != nil {
525 return GetBooksResp{}, errors.Wrap(err, "making http request")
526 }
527
528 var resp GetBooksResp
529 if err := json.NewDecoder(res.Body).Decode(&resp); err != nil {
530 return GetBooksResp{}, errors.Wrap(err, "decoding payload")
531 }
532
533 return resp, nil
534}
535
536// PresigninResponse is a reponse from /v3/presignin endpoint
537type PresigninResponse struct {

Callers 1

migrations.goFile · 0.92

Calls 1

doAuthorizedReqFunction · 0.85

Tested by

no test coverage detected