Documentation
¶
Index ¶
- func OptionColors(data *BoardData) map[string]map[string]string
- type BoardData
- type Card
- type Client
- func (c *Client) GetProjectBoard(projectID string) (*BoardData, error)
- func (c *Client) ListOrgProjects(org string) ([]Project, error)
- func (c *Client) ListUserProjects(login string) ([]Project, error)
- func (c *Client) ListViewerOrgs() ([]string, error)
- func (c *Client) ViewerLogin() (string, error)
- type Column
- type FieldOption
- type Label
- type Project
- type ProjectView
- type RawItem
- type SelectField
- type VisibleField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoardData ¶
type BoardData struct {
Views []ProjectView
Fields []SelectField
Items []RawItem
}
BoardData holds everything fetched from a project in one call. Grouping into columns is done client-side via GroupByField.
type Card ¶
type Card struct {
ID string
Type string // ISSUE | PULL_REQUEST | DRAFT_ISSUE
Number int
Title string
State string
URL string
Repo string
Assignees []string
Labels []Label
Status string
Body string
FieldValues map[string]string // all field values keyed by field name
}
Card is a single item on the board.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the go-gh GraphQL client.
func (*Client) GetProjectBoard ¶
GetProjectBoard fetches views, fields, and all items for a project. Use GroupByField to render a specific view's columns.
func (*Client) ListOrgProjects ¶
ListOrgProjects fetches up to 50 open projects for the given org login.
func (*Client) ListUserProjects ¶
ListUserProjects fetches up to 50 open projects for the given user login.
func (*Client) ListViewerOrgs ¶
ListViewerOrgs returns the login names of orgs the authenticated user belongs to.
func (*Client) ViewerLogin ¶
ViewerLogin returns the authenticated user's login.
type Column ¶
Column is a named group of cards on a board view.
func GroupByField ¶
GroupByField buckets RawItems into Columns using the named single-select field. Column order follows the field's option order. Falls back to "No <field>" bucket.
type FieldOption ¶
type FieldOption struct {
Name string
Color string // GitHub enum: GRAY | BLUE | GREEN | YELLOW | ORANGE | RED | PINK | PURPLE
}
FieldOption is one option of a single-select field, including its GitHub color enum.
type Project ¶
type Project struct {
ID string
Number int
Title string
Owner string
Description string
URL string
UpdatedAt string
}
Project represents a GitHub Projects v2 project.
type ProjectView ¶
type ProjectView struct {
ID string
Name string
Layout string // BOARD_LAYOUT | TABLE_LAYOUT | ROADMAP_LAYOUT
GroupByField string
VisibleFields []VisibleField
}
ProjectView mirrors a saved view from GitHub Projects v2.
type RawItem ¶
type RawItem struct {
ID string
Type string
IsArchived bool
Number int
Title string
State string
URL string
Repo string
Assignees []string
Labels []Label
Body string
FieldValues map[string]string // field name → selected option name
}
RawItem is an ungrouped project item with all its field values.
type SelectField ¶
type SelectField struct {
ID string
Name string
Options []FieldOption
}
SelectField is a single-select field with ordered options.
type VisibleField ¶
type VisibleField struct {
ID string
Name string
DataType string // TITLE | ASSIGNEES | SINGLE_SELECT | DATE | NUMBER | TEXT | ITERATION | MILESTONE | REPOSITORY | LABELS | LINKED_PULL_REQUESTS
}
VisibleField is a field configured to be shown in a view.