-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
|
||
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. |
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.
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?
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.
ping @junaire for a look.
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.
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?
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.
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.
docs/rfcs/0-example.md
Outdated
@@ -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) |
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.
- 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) |
docs/rfcs/0-example.md
Outdated
- 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) |
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.
- 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) |
docs/rfcs/0-example.md
Outdated
- 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> |
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.
# GSP-0: <proposal name> | |
# RFC-0: <proposal name> |
docs/rfcs/0-example.md
Outdated
# GSP-0: <proposal name> | ||
|
||
- Updates: (delete this part if not applicable) | ||
- [GSP-20](./20-abc): Deletes something |
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.
- [GSP-20](./20-abc): Deletes something | |
- [RFC-20](./20-abc): Deletes something |
docs/rfcs/0-example.md
Outdated
- 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 |
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.
- [GSP-10](./10-do-be-do-be-do): Adds something | |
- [RFC-10](./10-do-be-do-be-do): Adds something |
docs/rfcs/0-example.md
Outdated
- [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 |
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.
- [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 |
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.
# GSP-14: Gdrive for go-storage design | |
# RFC-14: Gdrive for go-storage design |
In this PR, we will discuss some details about our design.