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

DirectoryHelper with Glob support; GCS NewWriter should truncate #18

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

jlewi
Copy link
Owner

@jlewi jlewi commented Jun 21, 2024

  • Create a new interface DirectoryHelper which includes support for matching globs
  • Change the semantics of Gcs.NewWriter to not return an error if the object exists
    • Instead just truncate the object
    • This is consistent with the LocalFileHelper which uses os.Create
    • If the caller doesn't want to overwrite existing objects they should call Exists to check if it already exists.
  • Remove duplicate code
    • For some reason the gcs package was defining the interface and LocalFileHelper.
    • This was probably a result of not deleting code after refactoring into a separate package
    • That probably happened when the code was in the hydros repository.

* Create a new interface DirectoryHelper which includes support for matching globs
* Change the semantics of Gcs.NewWriter to not return an error if the object exists
  * Instead just truncate the object
  * This is consistent with the LocalFileHelper which uses os.Create
  * If the caller doesn't want to overwrite existing objects they should call Exists to check if it already exists.
* Remove duplicate code
  * For some reason the gcs package was defining the interface and LocalFileHelper.
  * This was probably a result of not deleting code after refactoring into a separate package
  * That probably happened when the code was in the hydros repository.
@jlewi jlewi enabled auto-merge (squash) June 21, 2024 13:37
@jlewi jlewi merged commit bb65202 into main Jun 21, 2024
1 check passed
@jlewi jlewi deleted the jlewi/files branch June 21, 2024 13:40
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.

1 participant