{"modulePath":"github.com/grafana/github-datasource","version":"v1.9.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package projects\n\n## Constants\n\n```go\nconst PageNumberLimit = 2\n```\nPageNumberLimit is the limit on the number of pages that will be traversed\n\n## Functions\n\n```go\nfunc ProjectNumber(val any) int\n```\nProjectNumber ...\n\n## Types\n\n```go\ntype Assignees struct {\n\tPageInfo   models.PageInfo\n\tTotalCount int64\n\tNodes      []models.User\n}\n```\nAssignees to the ProjectItem\n\n```go\ntype CommonField struct {\n\tCommon ProjectV2FieldCommon `graphql:\"... on ProjectV2FieldCommon\"`\n}\n```\nCommonField ...\n\n```go\ntype Content struct {\n\tTitle     *string\n\tBody      *string\n\tCreatedAt *githubv4.DateTime\n\tAssignees *Assignees `graphql:\"assignees(first: 10)\"`\n}\n```\nContent of the ProjectItem\n\n```go\ntype Field struct {\n\tCommon ProjectV2FieldCommon `graphql:\"... on ProjectV2FieldCommon\"`\n}\n```\nField is a field on a ProjectItem\n\n```go\ntype FieldValue struct {\n\tDateValue      ProjectV2ItemFieldDateValue         `graphql:\"... on ProjectV2ItemFieldDateValue\"`\n\tTextValue      ProjectV2ItemFieldTextValue         `graphql:\"... on ProjectV2ItemFieldTextValue\"`\n\tSelectValue    ProjectV2ItemFieldSingleSelectValue `graphql:\"... on ProjectV2ItemFieldSingleSelectValue\"`\n\tIterationValue ProjectV2ItemFieldIterationValue    `graphql:\"... on ProjectV2ItemFieldIterationValue\"`\n\tLabelsValue    ProjectV2ItemFieldLabelValue        `graphql:\"... on ProjectV2ItemFieldLabelValue\"`\n\tNumberValue    ProjectV2ItemFieldNumberValue       `graphql:\"... on ProjectV2ItemFieldNumberValue\"`\n\tReviewerValue  ProjectV2ItemFieldReviewerValue     `graphql:\"... on ProjectV2ItemFieldReviewerValue\"`\n\tRepoValue      ProjectV2ItemFieldRepositoryValue   `graphql:\"... on ProjectV2ItemFieldRepositoryValue\"`\n}\n```\nFieldValue is a value for a Field\n\n```go\ntype FieldValues struct {\n\tPageInfo   models.PageInfo\n\tTotalCount int64\n\tNodes      []FieldValue\n}\n```\nFieldValues are the values of each Field of a ProjectItem\n\n```go\ntype IssueContent struct {\n\tTitle     *string\n\tBody      *string\n\tCreatedAt *githubv4.DateTime\n\tAssignees *Assignees `graphql:\"assignees(first: 10)\"`\n\tMilestone *models.Milestone\n\tClosedAt  *githubv4.DateTime\n}\n```\nIssueContent of the ProjectItem\n\n```go\ntype Project struct {\n\tNumber           int64\n\tTitle            string\n\tURL              string\n\tClosed           bool\n\tPublic           bool\n\tClosedAt         githubv4.DateTime\n\tCreatedAt        githubv4.DateTime\n\tUpdatedAt        githubv4.DateTime\n\tShortDescription string\n}\n```\nProject is a GitHub project\n\n```go\ntype ProjectItem struct {\n\tContent     ProjectV2ItemContent\n\tFieldValues FieldValues `graphql:\"fieldValues(first: 100)\"`\n\tID          string\n\tIsArchived  bool\n\tType        string\n\tCreatedAt   githubv4.DateTime\n\tUpdatedAt   githubv4.DateTime\n}\n```\nProjectItem is a GitHub project item\n\n```go\ntype ProjectItemsWithFields struct {\n\tItems   []ProjectItem\n\tFields  []Field\n\tFilters []models.Filter\n}\n```\nProjectItemsWithFields ...\n\n```go\nfunc GetAllProjectItems(ctx context.Context, client models.Client, opts models.ProjectOptions) (*ProjectItemsWithFields, error)\n```\nGetAllProjectItems uses the graphql endpoint API to list all project items in the repository\n\n```go\nfunc GetProjectsItemsInRange(ctx context.Context, client models.Client, opts models.ProjectOptions, from time.Time, to time.Time) (*ProjectItemsWithFields, error)\n```\nGetProjectsItemsInRange retrieves every project from the org and then returns the ones that fall within the given time range.\n\n```go\nfunc (p ProjectItemsWithFields) Frames() data.Frames\n```\nFrames converts the list of Projects to a Grafana DataFrame\n\n```go\ntype ProjectLabel struct {\n\tName string\n}\n```\nProjectLabel ...\n\n```go\ntype ProjectLabels struct {\n\tNodes []ProjectLabel\n}\n```\nProjectLabels ...\n\n```go\ntype ProjectV2FieldCommon struct {\n\tName     string\n\tDataType string\n}\n```\nProjectV2FieldCommon is common to fields\n\n```go\ntype ProjectV2ItemContent struct {\n\tDraftIssue  Content      `graphql:\"... on DraftIssue\"`\n\tIssue       IssueContent `graphql:\"... on Issue\"`\n\tPullRequest IssueContent `graphql:\"... on PullRequest\"`\n}\n```\nProjectV2ItemContent contains Content for a ProjectItem\n\n```go\ntype ProjectV2ItemFieldDateValue struct {\n\tCreatedAt githubv4.DateTime\n\tDate      *string\n\tUpdatedAt githubv4.DateTime\n\tField     CommonField\n}\n```\nProjectV2ItemFieldDateValue is a value for a Date field\n\n```go\ntype ProjectV2ItemFieldIterationValue struct {\n\tTitle *string\n\tField CommonField\n}\n```\nProjectV2ItemFieldIterationValue is a value for an Iteration field\n\n```go\ntype ProjectV2ItemFieldLabelValue struct {\n\tProjectLabels `graphql:\"labels(first: 10)\"`\n\tField         CommonField\n}\n```\nProjectV2ItemFieldLabelValue is a value for a Labels field\n\n```go\ntype ProjectV2ItemFieldNumberValue struct {\n\tNumber *float64\n\tField  CommonField\n}\n```\nProjectV2ItemFieldNumberValue is a value for a Number field\n\n```go\ntype ProjectV2ItemFieldRepositoryValue struct {\n\tRepository models.Repository\n\tField      CommonField\n}\n```\nProjectV2ItemFieldRepositoryValue ...\n\n```go\ntype ProjectV2ItemFieldReviewerValue struct {\n\tReviewers `graphql:\"reviewers(first: 10)\"`\n\tField     CommonField\n}\n```\nProjectV2ItemFieldReviewerValue ...\n\n```go\ntype ProjectV2ItemFieldSingleSelectValue struct {\n\tName  *string\n\tField CommonField\n}\n```\nProjectV2ItemFieldSingleSelectValue is a value for a SingleSelect field\n\n```go\ntype ProjectV2ItemFieldTextValue struct {\n\tText  *string\n\tField CommonField\n}\n```\nProjectV2ItemFieldTextValue is a value for a Text field\n\n```go\ntype Projects []Project\n```\nProjects is a list of GitHub Projects\n\n```go\nfunc GetAllProjects(ctx context.Context, client models.Client, opts models.ProjectOptions) (Projects, error)\n```\nGetAllProjects uses the graphql endpoint API to list all projects in the repository\n\n```go\nfunc GetProjectsInRange(ctx context.Context, client models.Client, opts models.ProjectOptions, from time.Time, to time.Time) (Projects, error)\n```\nGetProjectsInRange retrieves every project from the org and then returns the ones that fall within the given time range.\n\n```go\nfunc (p Projects) Frames() data.Frames\n```\nFrames converts the list of Projects to a Grafana DataFrame\n\n```go\ntype QueryListProjects struct {\n\tOrganization struct {\n\t\tProjectsV2 struct {\n\t\t\tNodes    []Project\n\t\t\tPageInfo models.PageInfo\n\t\t} `graphql:\"projectsV2(first: 100, after: $cursor)\"`\n\t} `graphql:\"organization(login: $login)\"`\n}\n```\nQueryListProjects lists all projects in a repository\n\n\torganization(login: \"grafana\") {\n\t\tprojectsV2(first: 100) {\n\t\t\tnodes {\n\t\t\t\tid\n\t\t\t\ttitle\n\t     ...\n\t\t\t}\n\t\t}\n\t}\n\n```go\ntype QueryListProjectsByUser struct {\n\tUser struct {\n\t\tProjectsV2 struct {\n\t\t\tNodes    []Project\n\t\t\tPageInfo models.PageInfo\n\t\t} `graphql:\"projectsV2(first: 100, after: $cursor)\"`\n\t} `graphql:\"user(login: $login)\"`\n}\n```\nQueryListProjectsByUser lists all projects by user\n\n```go\ntype QueryProject struct {\n\tOrganization struct {\n\t\tProjectV2 struct {\n\t\t\tFields struct {\n\t\t\t\tTotalCount int64\n\t\t\t\tNodes      []Field\n\t\t\t\tPageInfo   models.PageInfo\n\t\t\t} `graphql:\"fields(first: 100)\"`\n\t\t\tItems struct {\n\t\t\t\t// Edges\n\t\t\t\tTotalCount int64\n\t\t\t\tNodes      []ProjectItem\n\t\t\t\tPageInfo   models.PageInfo\n\t\t\t} `graphql:\"items(first: 100, after: $cursor)\"`\n\t\t} `graphql:\"projectV2(number: $number)\"`\n\t} `graphql:\"organization(login: $login)\"`\n}\n```\nQueryProject lists project items in a project\n\n\torganization(login: \"grafana\") {\n\t\tprojectV2(number: 218) {\n\t\t\titems(first: 50) {\n\t\t\t\t\ttotalCount\n\t\t\t\t\tnodes {\n\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\tcreatedAt\n\t\t\t\t\t}\n\t\t\t},\n\t\t\tfields(first: 50) {\n\t\t\t\ttotalCount\n\t\t\t\tnodes{\n\t\t\t \t... on ProjectV2FieldCommon {\n\t\t\t\t\t name\n\t\t\t\t\t dataType\n\t\t\t \t}\n\t\t\t\t}\n\t\t\t},\n\t\t}\n\t}\n\n```go\ntype QueryProjectByUser struct {\n\tUser struct {\n\t\tProjectV2 struct {\n\t\t\tFields struct {\n\t\t\t\tTotalCount int64\n\t\t\t\tNodes      []Field\n\t\t\t\tPageInfo   models.PageInfo\n\t\t\t} `graphql:\"fields(first: 100)\"`\n\t\t\tItems struct {\n\t\t\t\t// Edges\n\t\t\t\tTotalCount int64\n\t\t\t\tNodes      []ProjectItem\n\t\t\t\tPageInfo   models.PageInfo\n\t\t\t} `graphql:\"items(first: 100, after: $cursor)\"`\n\t\t} `graphql:\"projectV2(number: $number)\"`\n\t} `graphql:\"user(login: $login)\"`\n}\n```\nQueryProjectByUser lists GitHub projects by User\n\n```go\ntype Reviewer struct {\n\tmodels.User `graphql:\"... on User\"`\n}\n```\nReviewer ...\n\n```go\ntype Reviewers struct {\n\tNodes []Reviewer\n}\n```\nReviewers ...\n\n","path":"github.com/grafana/github-datasource/pkg/github/projects","name":"projects","synopsis":"","isRedistributable":true}
