Client refactoring#22
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a major refactor and redesign of the DFS client, replacing the previous CLI and internal structure with a new, modular, and production-ready SDK (
dfsclient). The CLI is now a thin wrapper over this SDK and supports robust commands for uploading, downloading, listing, and deleting files. The previous monolithic and manually-wired approach is replaced by a clean, extensible API with clear separation between public and internal code.The most important changes are:
SDK Redesign and Public API (
dfsclient):dfsclientpackage, which provides a clean, public SDK for interacting with the distributed file system, including types for progress reporting, upload/download results, and file info. All internal logic is hidden behind this façade. [1] [2]WithMetadataAddrs,WithChunkSize, etc.), enabling easy customization and environment overrides.CLI Overhaul:
client/cmd/main.gowith a new CLI inclient/cmd/dfs-cli/main.gothat is a thin wrapper over thedfsclientSDK, supportingupload,download,list, anddeletecommands with user-friendly output and progress reporting. [1] [2]Internal Structure and Configuration:
client/internalpackages, ensuring a clear separation between public API and internal logic. The oldclient/config.gois replaced byclient/internal/dfsclientconfig.Removal of Legacy Code:
client/cmd/main.go,client/config.go) that were tightly coupled and less flexible, in favor of the new modular approach. [1] [2]This refactor provides a modern, maintainable, and extensible foundation for the DFS client, making it easier to use both as a CLI and as a library in other Go programs.