Skip to content

Refactor: move types from centralized pkg/api/types.go to domain-specific packages#917

Open
rakshityadav1868 wants to merge 1 commit into
goharbor:mainfrom
rakshityadav1868:moving-struct
Open

Refactor: move types from centralized pkg/api/types.go to domain-specific packages#917
rakshityadav1868 wants to merge 1 commit into
goharbor:mainfrom
rakshityadav1868:moving-struct

Conversation

@rakshityadav1868
Copy link
Copy Markdown

Overview

This PR completes the refactoring of type definitions in the harbor-cli codebase by moving all types from the centralized pkg/api/types.go file to their respective domain-specific packages. This improves code organization, maintainability, and package cohesion.

Fixes #667
refrence #669

  • Refactor

Changes Made

Files Deleted

  • pkg/api/types.go - Centralized types file (now empty/deleted)

Files Created

  • pkg/api/list_flags.go - Shared ListFlags type used across 10+ handlers

Files Modified

  • pkg/api/registry_handler.go - Added CreateRegView and RegistryCredential
  • pkg/api/member_handler.go - Added ListMemberOptions, UpdateMemberOptions, GetMemberOptions
  • pkg/api/vulnerability_handler.go - Added ListVulnerabilityOptions
  • pkg/api/quota_handler.go - Added ListQuotaFlags
  • pkg/views/context/list/view.go - Added ListView type
  • pkg/views/context/switch/view.go - Added ListView type
  • cmd/harbor/root/context/list.go - Updated imports
  • pkg/prompt/prompt.go - Updated imports

Testing

Screenshot 2026-05-12 at 2 20 03 PM

No error while building and tested using Dagger also dagger call test and dagger call lint there were also no errors

Signed-off-by: Rakshit Yadav <yadavrakshit60@gmail.com>
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.

Chore: Move types to relevant packages

1 participant