rest

package
v0.0.0-...-bb38180 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2025 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertCommit

func ConvertCommit(c *ghrest.Commit) *github.Commit

Convert REST API Commit to unified Commit

func ConvertCommitParent

func ConvertCommitParent(p *ghrest.Commit) *github.CommitParent

func ConvertRepositoryCommit

func ConvertRepositoryCommit(c *ghrest.RepositoryCommit) *github.Commit

Convert REST API Commit to unified Commit

Types

type API

type API struct {
	// contains filtered or unexported fields
}

API provides access to GitHub's REST API, implementing various capabilities such as comparing commits.

func NewGitHubRESTAPI

func NewGitHubRESTAPI(client Client, logger *slog.Logger) *API

NewGitHubRESTAPI creates a new REST API.

func (*API) CompareCommits

func (a *API) CompareCommits(ctx context.Context, repo *github.Repo, base, head string, limit int) (*github.CommitsComparison, error)

type Client

type Client interface {
	CompareCommits(ctx context.Context, owner, repo string, base, head string, opts *ghrest.ListOptions) (*ghrest.CommitsComparison, *ghrest.Response, error)
}

Client defines the capabilities supported by this package.

type GitHubRESTClient

type GitHubRESTClient struct {
	// contains filtered or unexported fields
}

GitHubRESTClient implements the Client interface and forwards calls to the underlying go-github client while converting model types.

func NewGitHubRESTClient

func NewGitHubRESTClient(httpClient *http.Client) *GitHubRESTClient

func (*GitHubRESTClient) CompareCommits

func (c *GitHubRESTClient) CompareCommits(ctx context.Context, owner, repo, base, head string, opts *ghrest.ListOptions) (*ghrest.CommitsComparison, *ghrest.Response, error)

CompareCommits forwards the call to the go-github client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL