Skip to content
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

mobile: API updates #3155

Merged
merged 5 commits into from
Oct 4, 2019
Merged

mobile: API updates #3155

merged 5 commits into from
Oct 4, 2019

Conversation

mniewrzal
Copy link
Contributor

@mniewrzal mniewrzal commented Oct 2, 2019

What: Changes for mobile API:

  • expose SkipPeerCAWhitelist option in uplink config
  • expose Scope type
  • change default for bucket listing direction to storj.After
  • update automatic tests to use scope instead apikey

Why: we need update gomobile API to build Java API facade

Please describe the tests:

  • Test 1: automatic tests updated

Please describe the performance impact: none

Code Review Checklist (to be filled out by reviewer)

  • Does the PR describe what changes are being made?
  • Does the PR describe why the changes are being made?
  • Does the code follow our style guide?
  • Does the code follow our testing guide?
  • Is the PR appropriately sized? (If it could be broken into smaller PRs it should be)
  • Does the new code have enough tests? (every PR should have tests or justification otherwise. Bug-fix PRs especially)
  • Does the new code have enough documentation that answers "how do I use it?" and "what does it do?"? (both source documentation and higher level, diagrams?)
  • Does any documentation need updating?
  • Do the database access patterns make sense?

@mniewrzal mniewrzal added Request Code Review Code review requested Reviewer Can Merge If all checks have passed, non-owner can merge PR labels Oct 2, 2019
@mniewrzal mniewrzal requested a review from a team October 2, 2019 14:04
@cla-bot cla-bot bot added the cla-signed label Oct 2, 2019
@ghost ghost requested review from bryanchriswhite and rikysya and removed request for a team October 2, 2019 14:04
kaloyan-raev
kaloyan-raev previously approved these changes Oct 2, 2019
Copy link
Contributor

@bryanchriswhite bryanchriswhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I understanding correctly that the purpose for the struct wrappers around things like Scope, APIKey, etc. is to be able to alter method definitions? If so, since we're now defining the high-level API in java, can we push that logic into java and just use the libuplink structs directly in the gomobile code (admittedly, that may be out of scope for this PR)? It's a bit confusing to follow structs of the same name defined in libuplink and then again in the gomobile code.

bryanchriswhite
bryanchriswhite previously approved these changes Oct 4, 2019
Copy link
Contributor

@bryanchriswhite bryanchriswhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from my previous comment/question, this looks good!

@mniewrzal
Copy link
Contributor Author

Am I understanding correctly that the purpose for the struct wrappers around things like Scope, APIKey, etc. is to be able to alter method definitions? If so, since we're now defining the high-level API in java, can we push that logic into java and just use the libuplink structs directly in the gomobile code (admittedly, that may be out of scope for this PR)? It's a bit confusing to follow structs of the same name defined in libuplink and then again in the gomobile code.

Purpose of mobile package is to adjust our libuplink code to code that can be used by gomobile to generate Java code. Gomobile have some limitation and this additional code is necessary even if we are doing manual Java API.
See https://godoc.org/golang.org/x/mobile/cmd/gobind#hdr-Type_restrictions

@@ -146,7 +152,7 @@ func (project *Project) ListBuckets(cursor string, limit int) (*BucketList, erro
scope := project.scope.child()
opts := libuplink.BucketListOptions{
Cursor: cursor,
Direction: storj.Forward,
Direction: storj.After,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe let's change the cursor name here, to make it clear that it defaults to after. e.g. after string

egonelbre
egonelbre previously approved these changes Oct 4, 2019
@mniewrzal mniewrzal merged commit 2f5ede6 into master Oct 4, 2019
@mniewrzal mniewrzal deleted the mn/mobile-api-updates branch October 4, 2019 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed Request Code Review Code review requested Reviewer Can Merge If all checks have passed, non-owner can merge PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants