Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Add gdrive for go-storage design #14

Merged
merged 5 commits into from
Jul 24, 2021
Merged

Conversation

junaire
Copy link
Member

@junaire junaire commented Jul 18, 2021

In this PR, we will discuss some details about our design.

@junaire junaire mentioned this pull request Jul 18, 2021

If the file is in the root folder, then we just do a simple search by using `drive.service.Files.List().Q(searchArgs).Do()`. The return value type is `*drive.File`, and it's attribute `ID` is what we need.

But if the file path is like `foo/bar/demo.txt`, it would be a little complex.
Copy link
Contributor

Choose a reason for hiding this comment

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

If the path is complex like a/b/c/d/e/f/h/q.txt, it looks like we need to repeat the search many times.

How about cache the path -> id in memory with TTL?

Copy link
Contributor

Choose a reason for hiding this comment

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

ping @junaire for a look.

Copy link
Member Author

@junaire junaire Jul 23, 2021

Choose a reason for hiding this comment

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

OK, I'll work on it. However, I don't have too much experience with this and I would like to ask if we should use some third library like go-cache? Or just simply use the map from the standard library?

Copy link
Contributor

Choose a reason for hiding this comment

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

To simplify the implementation, use a map with Mutex is OK for now.

We can implement the TTL logic later by https://github.com/dgraph-io/ristretto or other libs.

@@ -0,0 +1,41 @@
- Author: (fill me in with `name <mail>`, e.g., Xuanwo <[email protected]>)
- Start Date: (fill me in with today's date, YYYY-MM-DD)
- RFC PR: [beyondstorage/go-storage#0](https://github.com/beyondstorage/go-storage/issues/0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- RFC PR: [beyondstorage/go-storage#0](https://github.com/beyondstorage/go-storage/issues/0)
- RFC PR: [beyondstorage/go-service-gdrive#0](https://github.com/beyondstorage/go-service-gdrive/issues/0)

- Author: (fill me in with `name <mail>`, e.g., Xuanwo <[email protected]>)
- Start Date: (fill me in with today's date, YYYY-MM-DD)
- RFC PR: [beyondstorage/go-storage#0](https://github.com/beyondstorage/go-storage/issues/0)
- Tracking Issue: [beyondstorage/go-storage#0](https://github.com/beyondstorage/go-storage/issues/0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Tracking Issue: [beyondstorage/go-storage#0](https://github.com/beyondstorage/go-storage/issues/0)
- Tracking Issue: [beyondstorage/go-service-gdrive#0](https://github.com/beyondstorage/go-service-gdrive/issues/0)

- RFC PR: [beyondstorage/go-storage#0](https://github.com/beyondstorage/go-storage/issues/0)
- Tracking Issue: [beyondstorage/go-storage#0](https://github.com/beyondstorage/go-storage/issues/0)

# GSP-0: <proposal name>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# GSP-0: <proposal name>
# RFC-0: <proposal name>

# GSP-0: <proposal name>

- Updates: (delete this part if not applicable)
- [GSP-20](./20-abc): Deletes something
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- [GSP-20](./20-abc): Deletes something
- [RFC-20](./20-abc): Deletes something

- Updates: (delete this part if not applicable)
- [GSP-20](./20-abc): Deletes something
- Updated By: (delete this part if not applicable)
- [GSP-10](./10-do-be-do-be-do): Adds something
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- [GSP-10](./10-do-be-do-be-do): Adds something
- [RFC-10](./10-do-be-do-be-do): Adds something

- [GSP-20](./20-abc): Deletes something
- Updated By: (delete this part if not applicable)
- [GSP-10](./10-do-be-do-be-do): Adds something
- [GSP-1000](./1000-lalala): Deprecates this RFC
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- [GSP-1000](./1000-lalala): Deprecates this RFC
- [RFC-1000](./1000-lalala): Deprecates this RFC

- RFC PR: [beyondstorage/go-service-gdrive#14](https://github.com/beyondstorage/go-service-gdrive/issues/14)
- Tracking Issue: [beyondstorage/go-service-gdrive#15](https://github.com/beyondstorage/go-service-gdrive/issues/15)

# GSP-14: Gdrive for go-storage design
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# GSP-14: Gdrive for go-storage design
# RFC-14: Gdrive for go-storage design

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants