Documentation ¶
Index ¶
- func IssueOrPullRequestID(client api.GQLClient, rawURL string) (string, error)
- func NewClient() (api.GQLClient, error)
- func OwnerID(client api.GQLClient, login string, t OwnerType) (string, error)
- func ViewerLoginName(client api.GQLClient) (string, error)
- type ClientOptions
- type DraftIssue
- type Issue
- type Owner
- type OwnerType
- type PageInfo
- type Project
- type ProjectField
- type ProjectItem
- type PullRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IssueOrPullRequestID ¶
IssueOrPullRequestID returns the ID of the issue or pull request from a URL.
Types ¶
type ClientOptions ¶
type DraftIssue ¶
type Owner ¶
func NewOwner ¶
NewOwner creates a project Owner When userLogin == "@me", userLogin becomes the current viewer If userLogin is not empty, it is used to lookup the user owner If orgLogin is not empty, it is used to lookup the org owner If both userLogin and orgLogin are empty, interative mode is used to select an owner from the current viewer and their organizations
type OwnerType ¶
type OwnerType string
OwnerType is the type of the owner of a project, which can be either a user or an organization. Viewer is the current user.
const OrgOwner OwnerType = "ORGANIZATION"
const UserOwner OwnerType = "USER"
const ViewerOwner OwnerType = "VIEWER"
type PageInfo ¶
PageInfo is a PageInfo GraphQL object https://docs.github.com/en/graphql/reference/objects#pageinfo.
type Project ¶
type Project struct { Number int URL string ShortDescription string Public bool Closed bool Title string ID string Readme string Items struct { TotalCount int } Fields struct { Nodes []ProjectField } `graphql:"fields(first:100)"` Owner struct { User struct { Login string } `graphql:"... on User"` Organization struct { Login string } `graphql:"... on Organization"` } }
Project is a ProjectV2 GraphQL object https://docs.github.com/en/graphql/reference/objects#projectv2.
func NewProject ¶
NewProject creates a project based on the owner and project number if number is 0 it will prompt the user to select a project interactively otherwise it will make a request to get the project by number
type ProjectField ¶
type ProjectField struct { TypeName string `graphql:"__typename"` Field struct { ID string Name string DataType string } `graphql:"... on ProjectV2Field"` IterationField struct { ID string Name string DataType string } `graphql:"... on ProjectV2IterationField"` SingleSelectField struct { ID string Name string DataType string } `graphql:"... on ProjectV2SingleSelectField"` }
ProjectField is a ProjectV2FieldConfiguration GraphQL object https://docs.github.com/en/graphql/reference/unions#projectv2fieldconfiguration.
func ProjectFields ¶
ProjectFields returns the fields of a project. If the OwnerType is VIEWER, no login is required.
func (ProjectField) Name ¶
func (p ProjectField) Name() string
Name is the name of the project field.
func (ProjectField) Type ¶
func (p ProjectField) Type() string
Type is the typename of the project field.
type ProjectItem ¶
type ProjectItem struct { Id string TypeName string `graphql:"type"` Content struct { DraftIssue DraftIssue `graphql:"... on DraftIssue"` PullRequest PullRequest `graphql:"... on PullRequest"` Issue Issue `graphql:"... on Issue"` } }
ProjectItem is a ProjectV2Item GraphQL object https://docs.github.com/en/graphql/reference/objects#projectv2item.
func ProjectItems ¶
ProjectItems returns the items of a project. If the OwnerType is VIEWER, no login is required.
func (ProjectItem) ID ¶
func (p ProjectItem) ID() string
func (ProjectItem) Number ¶
func (p ProjectItem) Number() int
Number is the number of the project item. It is only valid for issues and pull requests.
func (ProjectItem) Repo ¶
func (p ProjectItem) Repo() string
Repo is the repository of the project item. It is only valid for issues and pull requests.
func (ProjectItem) Title ¶
func (p ProjectItem) Title() string
Title is the title of the project item.
func (ProjectItem) Type ¶
func (p ProjectItem) Type() string
Type is the underlying type of the project item.