Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Fields = map[string]Field{ "status": { Name: "status", Type: "enum", Extract: func(ub api.UserBook) any { return statusIDToName(ub.StatusID) }, }, "owned": { Name: "owned", Type: "boolean", Extract: func(ub api.UserBook) any { return ub.Owned }, }, "rating": { Name: "rating", Type: "number", Extract: func(ub api.UserBook) any { return ub.Rating }, }, "year": { Name: "year", Type: "number", Extract: func(ub api.UserBook) any { if len(ub.DateAdded) >= 4 { y, err := strconv.Atoi(ub.DateAdded[:4]) if err == nil { return y } } return 0 }, }, "pages": { Name: "pages", Type: "number", Extract: func(ub api.UserBook) any { if ub.Edition != nil && ub.Edition.Pages > 0 { return ub.Edition.Pages } return ub.Book.Pages }, }, "added": { Name: "added", Type: "date", Extract: func(ub api.UserBook) any { return ub.DateAdded }, }, "title": { Name: "title", Type: "string", Extract: func(ub api.UserBook) any { return ub.Book.Title }, }, "author": { Name: "author", Type: "string", Extract: func(ub api.UserBook) any { var authors []string for _, c := range ub.Book.Contributions { authors = append(authors, c.Author.Name) } return strings.Join(authors, ", ") }, }, }
Functions ¶
Types ¶
type Comparison ¶
Click to show internal directories.
Click to hide internal directories.