Documentation
¶
Index ¶
- func IsOrg(ctx context.Context, client *github.Client, owner string) (bool, error)
- func ListIssues(ctx context.Context, client *github.Client, owner, repo string) ([]*github.Issue, error)
- func ListRepos(ctx context.Context, client *github.Client, owner string, org bool) ([]*github.Repository, error)
- func NewExporter(ctx context.Context, _ *kloset_exporter.Options, _ string, ...) (kloset_exporter.Exporter, error)
- func NewGitHubClient(_ context.Context, token string) *github.Client
- func NewImporter(ctx context.Context, _ *importer.Options, _ string, config map[string]string) (importer.Importer, error)
- func ParseLocation(loc string) (owner, repo string)
- type GitHubExporter
- func (e *GitHubExporter) Close(_ context.Context) error
- func (e *GitHubExporter) CreateDirectory(_ context.Context, _ string) error
- func (e *GitHubExporter) CreateLink(_ context.Context, _, _ string, _ kloset_exporter.LinkType) error
- func (e *GitHubExporter) Root(_ context.Context) (string, error)
- func (e *GitHubExporter) SetPermissions(_ context.Context, _ string, _ *objects.FileInfo) error
- func (e *GitHubExporter) StoreFile(ctx context.Context, pathname string, fp io.Reader, _ int64) error
- type GitHubImporter
- func (g *GitHubImporter) Close(_ context.Context) error
- func (g *GitHubImporter) Flags() location.Flags
- func (g *GitHubImporter) Origin(_ context.Context) (string, error)
- func (g *GitHubImporter) Root(_ context.Context) (string, error)
- func (g *GitHubImporter) Scan(ctx context.Context) (<-chan *importer.ScanResult, error)
- func (g *GitHubImporter) Type(_ context.Context) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListIssues ¶
func ListIssues(ctx context.Context, client *github.Client, owner, repo string) ([]*github.Issue, error)
ListIssues returns all open and closed issues for the given repo.
func ListRepos ¶
func ListRepos(ctx context.Context, client *github.Client, owner string, org bool) ([]*github.Repository, error)
ListRepos returns all repositories for the given owner (user or org).
func NewExporter ¶
func NewExporter(ctx context.Context, _ *kloset_exporter.Options, _ string, config map[string]string) (kloset_exporter.Exporter, error)
NewExporter is the constructor called by the plakar SDK.
func NewGitHubClient ¶
NewGitHubClient returns an authenticated GitHub client.
func NewImporter ¶
func NewImporter(ctx context.Context, _ *importer.Options, _ string, config map[string]string) (importer.Importer, error)
NewImporter is the constructor called by the plakar SDK.
func ParseLocation ¶
ParseLocation extracts owner and optional repo from a location string like "github://owner/repo" or "github://owner".
Types ¶
type GitHubExporter ¶
type GitHubExporter struct {
// contains filtered or unexported fields
}
GitHubExporter implements the plakar exporter interface for GitHub.
func NewGitHubExporter ¶
func NewGitHubExporter(client *github.Client, owner, repoOverride string) *GitHubExporter
NewGitHubExporter creates an exporter directly from an existing client (used in tests).
func (*GitHubExporter) CreateDirectory ¶
func (e *GitHubExporter) CreateDirectory(_ context.Context, _ string) error
func (*GitHubExporter) CreateLink ¶
func (e *GitHubExporter) CreateLink(_ context.Context, _, _ string, _ kloset_exporter.LinkType) error
func (*GitHubExporter) SetPermissions ¶
type GitHubImporter ¶
type GitHubImporter struct {
// contains filtered or unexported fields
}
GitHubImporter implements the plakar importer interface for GitHub.
func NewGitHubImporter ¶
func NewGitHubImporter(client *github.Client, owner, repo string) *GitHubImporter
func (*GitHubImporter) Flags ¶
func (g *GitHubImporter) Flags() location.Flags
Flags returns the location flags for this importer (0 = remote API).
func (*GitHubImporter) Scan ¶
func (g *GitHubImporter) Scan(ctx context.Context) (<-chan *importer.ScanResult, error)
Scan returns a channel of ScanResults covering all repos, their manifests, git archives, and issues.