Skip to content

refactor: Introduce GitHubClient struct to eliminate HTTP boilerplate #152

@erishforG

Description

@erishforG

Problem

github/mod.rs has 10x Client::new() and 15+ identical header blocks (Accept, X-GitHub-Api-Version, User-Agent, bearer_auth). Every function repeats parse_github_remote + resolve_github_token + Client::new() + headers preamble.

Proposed Solution

Create a GitHubClient { client: Client, remote: GitHubRemote, token: String } with fn api_get/api_post/api_put/api_patch helpers. Enables connection reuse and cuts ~400 lines.

Category: refactor | Priority: high

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions