Skip to content

Client refactoring#22

Merged
Satyam709 merged 8 commits into
mainfrom
client-refactoring
May 1, 2026
Merged

Client refactoring#22
Satyam709 merged 8 commits into
mainfrom
client-refactoring

Conversation

@Satyam709

Copy link
Copy Markdown
Owner

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):

  • Introduced the new dfsclient package, 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]
  • Added flexible configuration via functional options (e.g., WithMetadataAddrs, WithChunkSize, etc.), enabling easy customization and environment overrides.

CLI Overhaul:

  • Replaced the old CLI in client/cmd/main.go with a new CLI in client/cmd/dfs-cli/main.go that is a thin wrapper over the dfsclient SDK, supporting upload, download, list, and delete commands with user-friendly output and progress reporting. [1] [2]

Internal Structure and Configuration:

  • Moved all internal configuration and implementation details into client/internal packages, ensuring a clear separation between public API and internal logic. The old client/config.go is replaced by client/internal/dfsclientconfig.

Removal of Legacy Code:

  • Deleted the previous CLI and configuration files (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.

@Satyam709 Satyam709 merged commit bbd676d into main May 1, 2026
3 checks passed
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