feat: add basic readwise example

This commit is contained in:
Alexander Navarro 2024-12-01 14:48:11 -03:00
parent f58db2ecaa
commit 92c9814e2a
10 changed files with 273 additions and 248 deletions

View file

@ -13,6 +13,16 @@ type Platform struct {
Collections []*Collection // Child nodes
}
func (platform *Platform) GetDefaultCollection() (*Collection, error) {
for _, collection := range platform.Collections {
if collection.IsDefault() {
return collection, nil
}
}
return nil, fmt.Errorf("Default collection not found")
}
// Is a type alias for FetchResponse containing a slice of Collection pointers.
type FetchCollectionResponse = FetchResponse[[]*Collection]