7 func getBookMap(api *BookStackApi) map[int]Book {
9 var byId = make(map[int]Book)
14 time.Sleep(time.Second / 2)
15 newBooks, _ := api.GetBooks(200, page)
16 hasMoreBooks = len(newBooks) == 200
18 books = append(books, newBooks...)
21 for _, book := range books {
28 func getChapterMap(api *BookStackApi) map[int]Chapter {
29 var chapters []Chapter
30 var byId = make(map[int]Chapter)
33 hasMoreChapters := true
35 time.Sleep(time.Second / 2)
36 newChapters, _ := api.GetChapters(200, page)
37 hasMoreChapters = len(newChapters) == 200
39 chapters = append(chapters, newChapters...)
42 for _, chapter := range chapters {
43 byId[chapter.Id] = chapter
49 func getPageMap(api *BookStackApi) map[int]Page {
51 var byId = make(map[int]Page)
56 time.Sleep(time.Second / 2)
57 newPages, _ := api.GetPages(200, page)
58 hasMorePages = len(newPages) == 200
60 pages = append(pages, newPages...)
63 for _, page := range pages {