Implement support for basic LR and paginated LR#3
Conversation
|
|
||
| // LookupResources performs a lookup for resources that the subject has the | ||
| // provided permission on. | ||
| func (c *Client) LookupResources( |
There was a problem hiding this comment.
Is there ever a time you'd want to use this method if the paginated method exists?
There was a problem hiding this comment.
Yeah; if you want to control the pagination manually
There was a problem hiding this comment.
Why not follow the pattern where you only have one function that works like this:
...
// Apply sane defaults like basic pagination.
for _, opt := range defaultLROpts() {
opt(req)
}
// Override the defaults with anything provided by the caller.
for _, opt := range opts {
opt(req)
}
...There was a problem hiding this comment.
Because I want people to know when reading the code that one is paginated automatically
There was a problem hiding this comment.
I don't want people to have to think about pagination at all unless they want to, haha. By defaulting it on, they avoid having to learn pagination even exists and trying to pick a sane default value, instead that's done for them.
There was a problem hiding this comment.
Sure, and they should use the paginated call for that. However, there will be times to not use it, and having the escape hatch is important
There was a problem hiding this comment.
Why wouldn't they be able to do that by also having an option for it?
| m.Run() | ||
| } | ||
|
|
||
| func ExampleClient_FilterRelationships() { |
There was a problem hiding this comment.
This was an intentional example that was for documentation. Can you add it back?
There was a problem hiding this comment.
Its still there, just as a test now
There was a problem hiding this comment.
I'd prefer it be an example, it's not really designed to exercise much, instead show off how to use the API.
|
|
||
| type Object struct { | ||
| Typ string | ||
| Type string |
There was a problem hiding this comment.
is this fully safe? i was avoiding the keyword
There was a problem hiding this comment.
Why wouldn't it be? Its capitalized
No description provided.