GetBooks gets books from the server
(ctx context.DnoteCtx, sessionKey string)
| 520 | |
| 521 | // GetBooks gets books from the server |
| 522 | func 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 |
| 537 | type PresigninResponse struct { |
no test coverage detected