-
Notifications
You must be signed in to change notification settings - Fork 0
feat(drive): add Drive client foundation and parent command #61
Copy link
Copy link
Closed
Description
Summary
Add the foundational infrastructure for Google Drive support, including the OAuth scope, API client package, and parent command registration.
Scope
This issue establishes the patterns that all subsequent Drive commands will follow.
Tasks
1. Add OAuth Scope
- Add
drive.DriveReadonlyScopetoAllScopesininternal/auth/auth.go - Import
google.golang.org/api/drive/v3
2. Create Drive API Client Package (internal/drive/)
-
interfaces.go- DefineDriveClientInterface -
client.go- Drive service wrapper withNewClient(ctx)factory -
files.go- File data types and parsing helpers
3. Create Command Package (internal/cmd/drive/)
-
drive.go- Parent command withfilesalias -
output.go- Shared output helpers (printJSON, ClientFactory)
4. Register Command
- Add import and
AddCommand()ininternal/cmd/root/root.go
Data Types
type File struct {
ID string `json:"id"`
Name string `json:"name"`
MimeType string `json:"mimeType"`
Size int64 `json:"size,omitempty"`
CreatedTime time.Time `json:"createdTime,omitempty"`
ModifiedTime time.Time `json:"modifiedTime,omitempty"`
Parents []string `json:"parents,omitempty"`
Owners []string `json:"owners,omitempty"`
WebViewLink string `json:"webViewLink,omitempty"`
Shared bool `json:"shared"`
}Interface
type DriveClientInterface interface {
ListFiles(query string, pageSize int64) ([]*File, error)
GetFile(fileID string) (*File, error)
DownloadFile(fileID string, mimeType string) ([]byte, error)
ExportFile(fileID string, exportMimeType string) ([]byte, error)
}Acceptance Criteria
-
gro driveshows help with available subcommands -
gro filesworks as alias -
make verifypasses - Client can be instantiated with valid OAuth token
Blocked By
None - this is the foundation issue
Blocks
- feat(drive): add list command #62 (list)
- feat(drive): add search command #63 (search)
- feat(drive): add get command #64 (get)
- feat(drive): add download command #65 (download)
- feat(drive): add tree command #66 (tree)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels