-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New apis for getting one or more collections #15
New apis for getting one or more collections #15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about my comment? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not tested it, but looks good to me 👍
|
||
|
||
// Fetch information about a collection: | ||
col,err := cl.Collections().Get("collection id").Do(context.Background()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
col,err := cl.Collections().Get("collection id").Do(context.Background()) | |
col, err := cl.Collections().Get("collection id").Do(context.Background()) |
@@ -6,23 +6,27 @@ | |||
# Usage | |||
|
|||
## Client | |||
Getting a single document by its id: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you removed it? 🤔
This is still possible, right?
Get all documents for a collection: | ||
```golang | ||
cl := outline.New() | ||
cl.Documents().GetAll().Collection("collection id").Do(context.Background(), func(d *outline.Document, err error) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you removed this, this is stil possible right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, these were not possible in the first place. They were just added to show how API may look like. I should have used 'github discussions' rather than adding this I guess. But anyways...upcoming PRs will definitely add documents functionality.
ID CollectionID `json:"id"` | ||
}{ID: id} | ||
|
||
copy := sl.New() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to get it right, this will "copy" the existing setup of Sling
(therefore, copy headers and stuff), correct?
New sub-clients types for fetching one or more collections.
Update Client creation to take
http.Client
from user. Also take api key as normal string, no need for making it a secret.Text because we inject it into the request immediately after receiving it. New internal common package which houses types and symbols which are required in both external tests and business logic.Updated README to reflect above changes and remove not yet existing scenarios.
Also: Updated minimum Go version to 1.19 as we use some new stuff ;)
Closes #2