Documentation
¶
Overview ¶
Package github adapts the GitHub Projects v2 client (internal/api) to the source.Source interface: it resolves the viewer, aggregates user and org projects, applies the config include/exclude filters, and loads boards.
Index ¶
- type Options
- type Source
- func (s *Source) Caps() source.Capabilities
- func (s *Source) Comment(item core.Card, body string) error
- func (s *Source) CreateIssue(string, source.Draft) (core.Card, error)
- func (s *Source) GetBoard(projectID string) (*core.BoardData, error)
- func (s *Source) ListProjects() ([]core.Project, error)
- func (s *Source) Name() string
- func (s *Source) SetAssignees(core.Card, []string) error
- func (s *Source) SetField(item core.Card, field, option string) error
- func (s *Source) SetLabels(core.Card, []string) error
- func (s *Source) SetState(item core.Card, state string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
Orgs []string // additional orgs to include beyond discovered memberships
IgnoreOrgs []string
IgnoreProjects []string
OnlyOrgs []string
OnlyProjects []string
}
Options configures which projects the GitHub source exposes. They mirror the config Defaults so the source owns all GitHub-specific listing policy.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is the GitHub Projects v2 backend.
func New ¶
New builds the GitHub source from the current gh auth context. It resolves the viewer login and merges discovered org memberships with configured orgs. It performs network calls, so it fails when gh is unauthenticated or offline.
func (*Source) Caps ¶
func (s *Source) Caps() source.Capabilities
Caps reports GitHub's capabilities: comment, close/reopen and card moves (single-select field edits) when the gh binary is present.
func (*Source) GetBoard ¶
GetBoard loads a project's board from GitHub and caches its field/option ids so a later card move can resolve names back to ids.
func (*Source) ListProjects ¶
ListProjects returns the viewer's projects plus the effective orgs' projects, filtered by the configured include/exclude lists.