Skip to content

Proposal: Move methods off of Client #2936

Description

@WillAbides

Tooling like update-urls and metadata could be simpler if API calls were made from methods on a *Service receiver. I think it would also make more sense for humans using go-github.

Currently there are handful of Client methods such as that would logically belong on different receivers. I propose we create the appropriate Service types for these.

The changes would be would be:

  • Client.Markdown -> MarkdownService.Markdown (maybe rename it to RenderMarkdown while we are at it)
  • Client.ListEmojis -> EmojisService.ListEmojis
  • Client.ListCodesOfConduct -> CodesOfConductService.ListCodesOfConduct
  • Client.GetCodeOfConduct -> CodesOfConductService.GetCodeOfConduct
  • Client.APIMeta -> MetaService.APIMeta
  • Client.Octocat -> MetaService.Octocat
  • Client.Zen -> MetaService.Zen

The original methods would be updated to call their new equivalent and marked deprecated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions