Documentation
¶
Index ¶
- func Parse(remotePath string) (*model.Metadata, error)
- type API
- func (api *API) CompareDiff(ctx context.Context, projectID any, target, source string) ([]*model.Diff, error)
- func (api *API) GetCommitDiff(ctx context.Context, projectID any, sha string) ([]*model.Diff, error)
- func (api *API) GetFileContent(ctx context.Context, projectID any, ref, fileName string) ([]byte, error)
- func (api *API) GetLatestCommitByPath(ctx context.Context, projectID any, path string) (*model.Commit, error)
- func (*API) GetOwnerAndRepoName(projectID any) (owner, repo string, err error)
- type Asset
- type Client
- type Release
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶ added in v0.13.0
type API struct {
// contains filtered or unexported fields
}
func NewGitHubAPI ¶ added in v0.13.0
func NewGitHubAPI(repo Repository) *API
func (*API) CompareDiff ¶ added in v0.13.0
func (*API) GetCommitDiff ¶ added in v0.21.7
func (*API) GetFileContent ¶ added in v0.13.0
func (*API) GetLatestCommitByPath ¶ added in v0.21.7
type Asset ¶
type Asset struct {
Name string `json:"name"`
BrowserDownloadURL string `json:"browser_download_url"`
}
Asset defines github release asset
type Client ¶
type Client struct{}
Client defines github client
func (*Client) DownloadAsset ¶
DownloadAsset downloads github asset based on the asset api path. Currently, it can only download asset from publicly available repository. `apiPath` follows prefix [https://api.github.com/repos], which can be generated by this provider parser. For more information, check [this](https://docs.github.com/en/rest/releases/releases) documentation.
func (*Client) DownloadRelease ¶
func (*Client) DownloadRelease(ctx context.Context, apiPath string) (*model.RepositoryRelease, error)
DownloadRelease downloads a release based on the API path
type Release ¶
type Release struct {
TagName string `json:"tag_name"`
Draft bool `json:"draft"`
Prerelease bool `json:"prerelease"`
Assets []*Asset `json:"assets"`
}
Release defines github repository release
type Repository ¶ added in v0.13.0
type Repository interface {
CompareCommits(ctx context.Context, owner, repo, base, head string, opts *github.ListOptions) (*github.CommitsComparison, *github.Response, error)
GetContents(ctx context.Context, owner, repo, path string, opts *github.RepositoryContentGetOptions) (fileContent *github.RepositoryContent, directoryContent []*github.RepositoryContent, resp *github.Response, err error)
ListCommits(ctx context.Context, owner, repo string, opts *github.CommitsListOptions) ([]*github.RepositoryCommit, *github.Response, error)
GetCommit(ctx context.Context, owner, repo, sha string, opts *github.ListOptions) (*github.RepositoryCommit, *github.Response, error)
}
Click to show internal directories.
Click to hide internal directories.