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

Basic GitHub filesystem support #89

Merged
merged 6 commits into from
Sep 16, 2020
Merged

Basic GitHub filesystem support #89

merged 6 commits into from
Sep 16, 2020

Conversation

edigaryev
Copy link
Contributor

A gateway to proper filesystem builtins needed for #53.

@edigaryev edigaryev requested a review from fkorotkov September 16, 2020 14:47
reference string
}

func New(owner, repo, reference, token string) *GitHub {
Copy link
Contributor

Choose a reason for hiding this comment

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

token is not used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, fixed in 728ad2c.

pkg/larker/fs/github/github.go Show resolved Hide resolved
@edigaryev
Copy link
Contributor Author

Maybe keep it github.Client to not create the client over and over again for every API call? client helper function can just return the right cleint in New.

Unfortunately oauth2.NewClient() requires a context.Context and it's not being transparent about whether it'll be used only for creation of the client or after some time later.

To avoid this ambiguity and to enable calling of fs.FileSystem methods with possibly different contexts I'm simply creating a new client for each method call.

Should be pretty cheap, huh?

@edigaryev edigaryev requested a review from fkorotkov September 16, 2020 18:19
@edigaryev edigaryev merged commit ad87b7e into master Sep 16, 2020
@edigaryev edigaryev deleted the github-fs branch September 16, 2020 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants