{"modulePath":"github.com/grafana/github-datasource","version":"v1.9.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\nPackage github contains more usable functions and types for interacting with the GitHubv4 API\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 GetQueryHandlers(s *QueryHandler) *datasource.QueryTypeMux\n```\nGetQueryHandlers creates the QueryTypeMux type for handling queries\n\n```go\nfunc InterPolateMacros(query string) (string, error)\n```\nInterPolateMacros interpolate macros on a given query string\n\n```go\nfunc UnmarshalQuery(b []byte, v interface{}) *backend.DataResponse\n```\nUnmarshalQuery attempts to unmarshal a query from JSON\n\n## Types\n\n```go\ntype CVSS struct {\n\tScore        float64\n\tVectorString string\n}\n```\nCVSS is a way of grading the severity of a vulnerability\n\n```go\ntype Commit struct {\n\tOID           string\n\tPushedDate    githubv4.DateTime\n\tAuthoredDate  githubv4.DateTime\n\tCommittedDate githubv4.DateTime\n\tMessage       githubv4.String\n\tAuthor        GitActor\n}\n```\nCommit represents a git commit from GitHub's API\n\n```go\ntype Commits []Commit\n```\nCommits is a slice of git commits\n\n```go\nfunc GetAllCommits(ctx context.Context, client models.Client, opts models.ListCommitsOptions) (Commits, error)\n```\nGetAllCommits lists every commit in a project. This function is slow and very prone to rate limiting.\n\n```go\nfunc GetCommitsInRange(ctx context.Context, client models.Client, opts models.ListCommitsOptions, from time.Time, to time.Time) (Commits, error)\n```\nGetCommitsInRange lists all commits in a repository within a time range.\n\n```go\nfunc (c Commits) Frames() data.Frames\n```\nFrames converts the list of commits to a Grafana DataFrame\n\n```go\ntype Datasource struct {\n\t// contains filtered or unexported fields\n}\n```\nDatasource handles requests to GitHub\n\n```go\nfunc NewDatasource(ctx context.Context, settings models.Settings) (*Datasource, error)\n```\nNewDatasource creates a new datasource for handling queries\n\n```go\nfunc (d *Datasource) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)\n```\nCheckHealth is the health check for GitHub\n\n```go\nfunc (d *Datasource) HandleCommitsQuery(ctx context.Context, query *models.CommitsQuery, req backend.DataQuery) (dfutil.Framer, error)\n```\nHandleCommitsQuery is the query handler for listing GitHub Commits\n\n```go\nfunc (d *Datasource) HandleContributorsQuery(ctx context.Context, query *models.ContributorsQuery, req backend.DataQuery) (dfutil.Framer, error)\n```\nHandleContributorsQuery is the query handler for listing GitHub Contributors\n\n```go\nfunc (d *Datasource) HandleGetLabels(w http.ResponseWriter, r *http.Request)\n```\nHandleGetLabels is the HTTP handler for the resource call for getting GitHub labels\n\n```go\nfunc (d *Datasource) HandleGetMilestones(w http.ResponseWriter, r *http.Request)\n```\nHandleGetMilestones is the HTTP handler for the resource call for getting GitHub milestones\n\n```go\nfunc (d *Datasource) HandleIssuesQuery(ctx context.Context, query *models.IssuesQuery, req backend.DataQuery) (dfutil.Framer, error)\n```\nHandleIssuesQuery is the query handler for listing GitHub Issues\n\n```go\nfunc (d *Datasource) HandleLabelsQuery(ctx context.Context, query *models.LabelsQuery, req backend.DataQuery) (dfutil.Framer, error)\n```\nHandleLabelsQuery is the query handler for listing GitHub Labels\n\n```go\nfunc (d *Datasource) HandleMilestonesQuery(ctx context.Context, query *models.MilestonesQuery, req backend.DataQuery) (dfutil.Framer, error)\n```\nHandleMilestonesQuery is the query handler for listing GitHub Milestones\n\n```go\nfunc (d *Datasource) HandlePackagesQuery(ctx context.Context, query *models.PackagesQuery, req backend.DataQuery) (dfutil.Framer, error)\n```\nHandlePackagesQuery is the query handler for listing GitHub Packages\n\n```go\nfunc (d *Datasource) HandleProjectsQuery(ctx context.Context, query *models.ProjectsQuery, req backend.DataQuery) (dfutil.Framer, error)\n```\nHandleProjectsQuery is the query handler for listing GitHub Projects\n\n```go\nfunc (d *Datasource) HandlePullRequestsQuery(ctx context.Context, query *models.PullRequestsQuery, req backend.DataQuery) (dfutil.Framer, error)\n```\nHandlePullRequestsQuery is the query handler for listing GitHub PullRequests\n\n```go\nfunc (d *Datasource) HandleReleasesQuery(ctx context.Context, query *models.ReleasesQuery, req backend.DataQuery) (dfutil.Framer, error)\n```\nHandleReleasesQuery is the query handler for listing GitHub Releases\n\n```go\nfunc (d *Datasource) HandleRepositoriesQuery(ctx context.Context, query *models.RepositoriesQuery, req backend.DataQuery) (dfutil.Framer, error)\n```\nHandleRepositoriesQuery is the query handler for listing GitHub Repositories\n\n```go\nfunc (d *Datasource) HandleStargazersQuery(ctx context.Context, query *models.StargazersQuery, req backend.DataQuery) (dfutil.Framer, error)\n```\nHandleStargazersQuery is the query handler for listing stargazers of a GitHub repository\n\n```go\nfunc (d *Datasource) HandleTagsQuery(ctx context.Context, query *models.TagsQuery, req backend.DataQuery) (dfutil.Framer, error)\n```\nHandleTagsQuery is the query handler for listing GitHub Tags\n\n```go\nfunc (d *Datasource) HandleVulnerabilitiesQuery(ctx context.Context, query *models.VulnerabilityQuery, req backend.DataQuery) (dfutil.Framer, error)\n```\nHandleVulnerabilitiesQuery is the query handler for listing GitHub Packages\n\n```go\nfunc (d *Datasource) HandleWorkflowUsageQuery(ctx context.Context, query *models.WorkflowUsageQuery, req backend.DataQuery) (dfutil.Framer, error)\n```\nHandleWorkflowUsageQuery is the query handler for getting the usage information of a specific workflow\n\n```go\nfunc (d *Datasource) HandleWorkflowsQuery(ctx context.Context, query *models.WorkflowsQuery, req backend.DataQuery) (dfutil.Framer, error)\n```\nHandleWorkflowsQuery is the query handler for listing workflows of a GitHub repository\n\n```go\nfunc (d *Datasource) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)\n```\nQueryData runs the query\n\n```go\ntype GitActor struct {\n\tName  string\n\tEmail string\n\tUser  models.User\n\tDate  githubv4.GitTimestamp\n}\n```\nA GitActor is a user that has performed a git action, like a commit\n\n```go\ntype GitActors []GitActor\n```\nGitActors is a list of GitHub users\n\n```go\nfunc (g GitActors) Frames() data.Frames\n```\nFrames converts the list of actors to a grafana data frame\n\n```go\ntype Issue struct {\n\tNumber    int64\n\tTitle     string\n\tClosedAt  githubv4.DateTime\n\tCreatedAt githubv4.DateTime\n\tUpdatedAt githubv4.DateTime\n\tClosed    bool\n\tAuthor    struct {\n\t\tmodels.User `graphql:\"... on User\"`\n\t}\n\tRepository Repository\n}\n```\nIssue represents a GitHub issue in a repository\n\n```go\ntype Issues []Issue\n```\nIssues is a slice of GitHub issues\n\n```go\nfunc GetIssuesInRange(ctx context.Context, client models.Client, opts models.ListIssuesOptions, from time.Time, to time.Time) (Issues, error)\n```\nGetIssuesInRange lists issues in a project given a time range.\n\n```go\nfunc (c Issues) Frames() data.Frames\n```\nFrames converts the list of issues to a Grafana DataFrame\n\n```go\ntype Label struct {\n\tColor       string `json:\"color\"`\n\tName        string `json:\"name\"`\n\tDescription string `json:\"description\"`\n}\n```\nLabel is a GitHub label used in Issues / Pull Requests\n\n```go\ntype Labels []Label\n```\nLabels is a list of GitHub labels\n\n```go\nfunc GetAllLabels(ctx context.Context, client models.Client, opts models.ListLabelsOptions) (Labels, error)\n```\nGetAllLabels gets all labels from a GitHub repository\n\n```go\nfunc (a Labels) Frames() data.Frames\n```\nFrames converts the list of labels to a Grafana DataFrame\n\n```go\ntype Milestones []models.Milestone\n```\nMilestones is a list of GitHub milestones\n\n```go\nfunc GetAllMilestones(ctx context.Context, client models.Client, opts models.ListMilestonesOptions) (Milestones, error)\n```\nGetAllMilestones lists milestones in a repository\n\n```go\nfunc (m Milestones) Frames() data.Frames\n```\nFrames converts the list of GitHub Milestones to a Grafana data frame\n\n```go\ntype Organization struct {\n\tName string\n}\n```\nAn Organization is a single GitHub organization\n\n```go\nfunc GetAllOrganizations(ctx context.Context, client models.Client) ([]Organization, error)\n```\nGetAllOrganizations lists the available organizations for the client\n\n```go\ntype Organizations []Organization\n```\nOrganizations is a slice of GitHub Organizations\n\n```go\nfunc (c Organizations) Frames() data.Frames\n```\nFrames converts the list of Organizations to a Grafana DataFrame\n\n```go\ntype Package struct {\n\tName        string\n\tPackageType githubv4.PackageType\n\tStatistics  PackageStatistics\n\tVersions    []PackageVersion\n}\n```\nPackage represents a GitHub Package\n\n```go\ntype PackageStatistics struct {\n\tDownloadsTotalCount int64\n}\n```\nPackageStatistics is a common object used in package versions and packages themselves\n\n```go\ntype PackageVersion struct {\n\tPreRelease bool\n\tPlatform   string\n\tVersion    string\n\tStatistics PackageStatistics\n}\n```\nPackageVersion is the version of a package. A package can have several versions.\n\n```go\ntype Packages []Package\n```\nPackages is a list of GitHub packages\n\n```go\nfunc GetAllPackages(ctx context.Context, client models.Client, opts models.ListPackagesOptions) (Packages, error)\n```\nGetAllPackages lists packages in a repository\n\n```go\nfunc (p Packages) Frames() data.Frames\n```\nFrames converts a list of Packages to a Grafana Data Frame\n\n```go\ntype PullRequest struct {\n\tNumber     int64\n\tTitle      string\n\tURL        string\n\tState      githubv4.PullRequestState\n\tAuthor     PullRequestAuthor\n\tClosed     bool\n\tIsDraft    bool\n\tLocked     bool\n\tMerged     bool\n\tClosedAt   githubv4.DateTime\n\tCreatedAt  githubv4.DateTime\n\tUpdatedAt  githubv4.DateTime\n\tMergedAt   githubv4.DateTime\n\tMergeable  githubv4.MergeableState\n\tMergedBy   *PullRequestAuthor\n\tRepository Repository\n}\n```\nPullRequest is a GitHub pull request\n\n```go\ntype PullRequestAuthor struct {\n\tUser models.User `graphql:\"... on User\"`\n}\n```\nPullRequestAuthor is the structure of the Author object in a Pull Request (which requires a graphQL object expansion on \\`User\\`)\n\n```go\ntype PullRequests []PullRequest\n```\nPullRequests is a list of GitHub Pull Requests\n\n```go\nfunc GetAllPullRequests(ctx context.Context, client models.Client, opts models.ListPullRequestsOptions) (PullRequests, error)\n```\nGetAllPullRequests uses the graphql search endpoint API to search all pull requests in the repository\n\n```go\nfunc GetPullRequestsInRange(ctx context.Context, client models.Client, opts models.ListPullRequestsOptions, from time.Time, to time.Time) (PullRequests, error)\n```\nGetPullRequestsInRange uses the graphql search endpoint API to find pull requests in the given time range.\n\n```go\nfunc (p PullRequests) Frames() data.Frames\n```\nFrames converts the list of Pull Requests to a Grafana DataFrame\n\n```go\ntype QueryHandler struct {\n\tDatasource Datasource\n}\n```\nQueryHandler is the main handler for datasource queries.\n\n```go\nfunc (s *QueryHandler) HandleCommits(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)\n```\nHandleCommits handles the plugin query for github Commits\n\n```go\nfunc (s *QueryHandler) HandleContributors(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)\n```\nHandleContributors handles the plugin query for github Contributors\n\n```go\nfunc (s *QueryHandler) HandleIssues(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)\n```\nHandleIssues handles the plugin query for github Issues\n\n```go\nfunc (s *QueryHandler) HandleLabels(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)\n```\nHandleLabels handles the plugin query for github Labels\n\n```go\nfunc (s *QueryHandler) HandleMilestones(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)\n```\nHandleMilestones handles the plugin query for github Milestones\n\n```go\nfunc (s *QueryHandler) HandlePackages(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)\n```\nHandlePackages handles the plugin query for github Packages\n\n```go\nfunc (s *QueryHandler) HandleProjects(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)\n```\nHandleProjects handles the plugin query for github Projects\n\n```go\nfunc (s *QueryHandler) HandlePullRequests(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)\n```\nHandlePullRequests handles the plugin query for github PullRequests\n\n```go\nfunc (s *QueryHandler) HandleReleases(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)\n```\nHandleReleases handles the plugin query for github Releases\n\n```go\nfunc (s *QueryHandler) HandleRepositories(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)\n```\nHandleRepositories handles the plugin query for github tags\n\n```go\nfunc (s *QueryHandler) HandleStargazers(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)\n```\nHandleStargazers handles the plugin query for GitHub stargazers\n\n```go\nfunc (s *QueryHandler) HandleTags(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)\n```\nHandleTags handles the plugin query for github tags\n\n```go\nfunc (s *QueryHandler) HandleVulnerabilities(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)\n```\nHandleVulnerabilities handles the plugin query for github Vulnerabilities\n\n```go\nfunc (s *QueryHandler) HandleWorkflowUsage(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)\n```\nHandleWorkflowUsage handles the plugin query for GitHub workflows\n\n```go\nfunc (s *QueryHandler) HandleWorkflows(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)\n```\nHandleWorkflows handles the plugin query for GitHub workflows\n\n```go\ntype QueryHandlerFunc func(context.Context, backend.DataQuery) backend.DataResponse\n```\nQueryHandlerFunc is the function signature used for mux.HandleFunc\n\n```go\ntype QueryListCommits struct {\n\tRepository struct {\n\t\tObject struct {\n\t\t\tCommit struct {\n\t\t\t\tHistory struct {\n\t\t\t\t\tNodes    []Commit\n\t\t\t\t\tPageInfo models.PageInfo\n\t\t\t\t} `graphql:\"history(first: 100, after: $cursor)\"`\n\t\t\t} `graphql:\"... on Commit\"`\n\t\t} `graphql:\"object(expression: $ref)\"`\n\t} `graphql:\"repository(name: $name, owner: $owner)\"`\n}\n```\nQueryListCommits is the object representation of the graphql query for retrieving a paginated list of commits for a project\n\n\tquery {\n\t\trepository(name:\"$name\", owner:\"$owner\") {\n\t\t\tobject(expression: \"master\") {\n\t\t\t\t... on Commit {\n\t\t\t\t\thistory {\n\t\t\t\t\t\tnodes {\n\t\t\t\t\t\t\tcommittedDate\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpageInfo{\n\t\t\t\t\t\t\thasNextPage\n\t\t\t\t\t\t\thasPreviousPage\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n```go\ntype QueryListCommitsInRange struct {\n\tRepository struct {\n\t\tObject struct {\n\t\t\tCommit struct {\n\t\t\t\tHistory struct {\n\t\t\t\t\tNodes    []Commit\n\t\t\t\t\tPageInfo models.PageInfo\n\t\t\t\t} `graphql:\"history(first: 100, after: $cursor, since: $since, until: $until)\"`\n\t\t\t} `graphql:\"... on Commit\"`\n\t\t} `graphql:\"object(expression: $ref)\"`\n\t} `graphql:\"repository(name: $name, owner: $owner)\"`\n}\n```\nQueryListCommitsInRange is the graphql query for retrieving a paginated list of commits within a time range\n\n```go\ntype QueryListContributors struct {\n\tRepository struct {\n\t\tUsers struct {\n\t\t\tNodes    Users\n\t\t\tPageInfo models.PageInfo\n\t\t} `graphql:\"mentionableUsers(query: $query, first: 100, after: $cursor)\"`\n\t} `graphql:\"repository(name: $name, owner: $owner)\"`\n}\n```\nQueryListContributors is the GraphQL query for listing contributors (or rather, mentionable users in a repository)\n\n```go\ntype QueryListLabels struct {\n\tRepository struct {\n\t\tLabels struct {\n\t\t\tNodes    Labels\n\t\t\tPageInfo models.PageInfo\n\t\t} `graphql:\"labels(first: 100, after: $cursor, query: $query)\"`\n\t} `graphql:\"repository(name: $name, owner: $owner)\"`\n}\n```\nQueryListLabels lists all labels in a repository\n\n\t{\n\t  repository(name: \"grafana\", owner: \"grafana\") {\n\t    labels(first: 100) {\n\t      nodes {\n\t        color\n\t        description\n\t        name\n\t      }\n\t    }\n\t  }\n\t}\n\n```go\ntype QueryListMilestones struct {\n\tRepository struct {\n\t\tMilestones struct {\n\t\t\tNodes    Milestones\n\t\t\tPageInfo models.PageInfo\n\t\t} `graphql:\"milestones(first: 100, after: $cursor, query: $query)\"`\n\t} `graphql:\"repository(name: $name, owner: $owner)\"`\n}\n```\nQueryListMilestones lists all milestones in a repository\n\n\t{\n\t  repository(name: \"grafana\", owner: \"grafana\") {\n\t    milestones(first: 100) {\n\t      nodes {\n\t        color\n\t        description\n\t        name\n\t      }\n\t    }\n\t  }\n\t}\n\n```go\ntype QueryListOrganizations struct {\n\tViewer struct {\n\t\tOrganizations struct {\n\t\t\tNodes    []Organization\n\t\t\tPageInfo models.PageInfo\n\t\t} `graphql:\"organizations(first: 100, after: $cursor)\"`\n\t}\n}\n```\nQueryListOrganizations is the GraphQL query for listing organizations\n\n```go\ntype QueryListPackages struct {\n\tRepository struct {\n\t\tPackages struct {\n\t\t\tNodes []struct {\n\t\t\t\tName        string\n\t\t\t\tPackageType githubv4.PackageType\n\t\t\t\tStatistics  PackageStatistics\n\t\t\t\tVersions    struct {\n\t\t\t\t\tNodes    []PackageVersion\n\t\t\t\t\tPageInfo models.PageInfo\n\t\t\t\t} `graphql:\"versions(first: 100, after: $versionsCursor)\"`\n\t\t\t}\n\t\t\tPageInfo models.PageInfo\n\t\t} `graphql:\"packages(names: $names, packageType: $packageType, first: 100, after: $cursor)\"`\n\t} `graphql:\"repository(name: $name, owner: $owner)\"`\n}\n```\nQueryListPackages is the GraphQL query for listing GitHub packages\n\n\t{\n\t  repository(name: \"grafana\", owner: \"grafana\") {\n\t    packages(names: \"\", packageType: \"\", first: 10) {\n\t      nodes {\n\t        id\n\t        name\n\t        packageType\n\t        statistics {\n\t          downloadsTotalCount\n\t        }\n\t        versions(first: 10) {\n\t          nodes {\n\t            preRelease\n\t            platform\n\t            version\n\t            statistics {\n\t              downloadsTotalCount\n\t            }\n\t          }\n\t          pageInfo {\n\t            hasNextPage\n\t            endCursor\n\t          }\n\t        }\n\t      }\n\t      totalCount\n\t      pageInfo {\n\t        endCursor\n\t        hasNextPage\n\t      }\n\t    }\n\t  }\n\t}\n\n```go\ntype QueryListPullRequests struct {\n\tSearch struct {\n\t\tNodes []struct {\n\t\t\tPullRequest PullRequest `graphql:\"... on PullRequest\"`\n\t\t}\n\t\tPageInfo models.PageInfo\n\t} `graphql:\"search(query: $query, type: ISSUE, first: 100, after: $cursor)\"`\n}\n```\nQueryListPullRequests lists all pull requests in a repository\n\n\t{\n\t  search(query: \"is:pr repo:grafana/grafana merged:2020-08-19..*\", type: ISSUE, first: 100) {\n\t    nodes {\n\t      ... on PullRequest {\n\t        id\n\t        title\n\t      }\n\t  }\n\t}\n\n```go\ntype QueryListReleases struct {\n\tRepository struct {\n\t\tReleases struct {\n\t\t\tNodes    []Release\n\t\t\tPageInfo models.PageInfo\n\t\t} `graphql:\"releases(first: 100, after: $cursor)\"`\n\t} `graphql:\"repository(owner: $owner, name: $name)\"`\n}\n```\nQueryListReleases is the GraphQL query for listing GitHub releases in a repository\n\n```go\ntype QueryListRepositories struct {\n\tSearch struct {\n\t\tNodes []struct {\n\t\t\tRepository Repository `graphql:\"... on Repository\"`\n\t\t}\n\t\tPageInfo models.PageInfo\n\t} `graphql:\"search(query: $query, type: REPOSITORY, first: 100, after: $cursor)\"`\n}\n```\nQueryListRepositories is the GraphQL query for retrieving a list of repositories for an organization\n\n\t{\n\t  search(query: \"is:pr repo:grafana/grafana merged:2020-08-19..*\", type: ISSUE, first: 100) {\n\t    nodes {\n\t      ... on PullRequest {\n\t        id\n\t        title\n\t      }\n\t  }\n\t}\n\n```go\ntype QueryListTags struct {\n\tRepository struct {\n\t\tRefs struct {\n\t\t\tNodes []struct {\n\t\t\t\tName   string\n\t\t\t\tTarget struct {\n\t\t\t\t\tTypeName string `graphql:\"__typename\"`\n\t\t\t\t\tTag      tag    `graphql:\"... on Tag\"`\n\t\t\t\t\tCommit   commit `graphql:\"... on Commit\"`\n\t\t\t\t}\n\t\t\t}\n\t\t\tPageInfo models.PageInfo\n\t\t} `graphql:\"refs(refPrefix: \\\"refs/tags/\\\", orderBy: {field: TAG_COMMIT_DATE, direction: DESC}, first: 100, after: $cursor)\"`\n\t} `graphql:\"repository(name: $name, owner: $owner)\"`\n}\n```\nQueryListTags is the GraphQL query for listing GitHub tags in a repository\n\n\t{\n\t\trepository(name: \"grafana\", owner: \"grafana\") {\n\t\t  refs(\n\t\t\trefPrefix: \"refs/tags/\"\n\t\t\torderBy: {field: TAG_COMMIT_DATE, direction: DESC}\n\t\t\tfirst: 30\n\t\t\tquery: \"\"\n\t\t  ) {\n\t\t\tnodes {\n\t\t\t  name\n\t\t\t  target {\n\t\t\t\t__typename\n\t\t\t\t... on Commit {\n\t\t\t\t  oid\n\t\t\t\t  author {\n\t\t\t\t\tdate\n\t\t\t\t\temail\n\t\t\t\t\tuser {\n\t\t\t\t\t  login\n\t\t\t\t\t  name\n\t\t\t\t\t  company\n\t\t\t\t\t}\n\t\t\t\t  }\n\t\t\t\t}\n\t\t\t\t... on Tag {\n\t\t\t\t  oid\n\t\t\t\t  tagger {\n\t\t\t\t\tdate\n\t\t\t\t\temail\n\t\t\t\t\tuser {\n\t\t\t\t\t  login\n\t\t\t\t\t  name\n\t\t\t\t\t  company\n\t\t\t\t\t}\n\t\t\t\t  }\n\t\t\t\t}\n\t\t\t  }\n\t\t\t}\n\t\t  }\n\t\t}\n\t  }\n\n```go\ntype QueryListVulnerabilities struct {\n\tRepository struct {\n\t\tVulnerabilityAlerts struct {\n\t\t\tNodes    Vulnerabilities\n\t\t\tPageInfo models.PageInfo\n\t\t} `graphql:\"vulnerabilityAlerts(first: 100, after: $cursor)\"`\n\t} `graphql:\"repository(name: $name, owner: $owner)\"`\n}\n```\nQueryListVulnerabilities lists all vulnerability alerts in a repository\n\n\t{\n\t    repository(name: \"repo-name\", owner: \"repo-owner\") {\n\t        vulnerabilityAlerts(first: 100) {\n\t            nodes {\n\t                createdAt\n\t                dismissedAt\n\t                securityVulnerability {\n\t                    package {\n\t                        name\n\t                    }\n\t                    advisory {\n\t                        description\n\t                    }\n\t                }\n\t            }\n\t        }\n\t    }\n\t}\n\n```go\ntype QuerySearchIssues struct {\n\tSearch struct {\n\t\tNodes []struct {\n\t\t\tIssue Issue `graphql:\"... on Issue\"`\n\t\t}\n\t\tPageInfo models.PageInfo\n\t} `graphql:\"search(query: $query, type: ISSUE, first: 100, after: $cursor)\"`\n}\n```\nQuerySearchIssues is the object representation of the graphql query for retrieving a paginated list of issues using the search query\n\n\t{\n\t  search(query: \"is:issue repo:grafana/grafana opened:2020-08-19..*\", type: ISSUE, first: 100) {\n\t    nodes {\n\t      ... on PullRequest {\n\t        id\n\t        title\n\t      }\n\t  }\n\t}\n\n```go\ntype QueryStargazers struct {\n\tRepository struct {\n\t\tStargazers struct {\n\t\t\tTotalCount int64\n\t\t\tPageInfo   models.PageInfo\n\t\t\tEdges      []Stargazer\n\t\t} `graphql:\"stargazers(first: 100, orderBy: {field: STARRED_AT, direction: DESC}, after: $cursor)\"`\n\t} `graphql:\"repository(owner: $owner, name: $name)\"`\n}\n```\nQueryStargazers is the object representation of the graphql query for retrieving a paginated list of stargazers for a repository\n\n\tquery {\n\t\trepository(owner: $owner, name: $name) {\n\t\t\tstargazers(first: 100, orderBy: {field: STARRED_AT, direction: DESC}, after: $cursor) {\n\t\t\t\ttotalCount\n\t\t\t\tpageInfo {\n\t\t\t\t\thasNextPage\n\t\t\t\t\tstartCursor\n\t\t\t\t\tendCursor\n\t\t\t\t}\n\t\t\t\tedges {\n\t\t\t\t\tstarredAt\n\t\t\t\t\tnode {\n\t\t\t\t\t\tid\n\t\t\t\t\t\tlogin\n\t\t\t\t\t\tname\n\t\t\t\t\t\tcompany\n\t\t\t\t\t\temail\n\t\t\t\t\t\turl\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n```go\ntype Release struct {\n\tID           string\n\tName         string\n\tAuthor       models.User\n\tIsDraft      bool\n\tIsPrerelease bool\n\tCreatedAt    githubv4.DateTime\n\tPublishedAt  githubv4.DateTime\n\tTagName      string\n\tURL          string\n}\n```\nRelease is a GitHub release. Every release has an associated tag.\n\n```go\ntype Releases []Release\n```\nReleases is a slice of GitHub releases\n\n```go\nfunc GetAllReleases(ctx context.Context, client models.Client, opts models.ListReleasesOptions) (Releases, error)\n```\nGetAllReleases retrieves every release from a repository\n\n```go\nfunc GetReleasesInRange(ctx context.Context, client models.Client, opts models.ListReleasesOptions, from time.Time, to time.Time) (Releases, error)\n```\nGetReleasesInRange retrieves every release from the repository and then returns the ones that fall within the given time range.\n\n```go\nfunc (c Releases) Frames() data.Frames\n```\nFrames converts the list of Releases to a Grafana DataFrame\n\n```go\ntype Repositories []Repository\n```\nRepositories is a list of GitHub repositories\n\n```go\nfunc GetAllRepositories(ctx context.Context, client models.Client, opts models.ListRepositoriesOptions) (Repositories, error)\n```\nGetAllRepositories retrieves all available repositories for an organization\n\n```go\nfunc (r Repositories) Frames() data.Frames\n```\nFrames converts the list of GitHub repositories to a Grafana Dataframe\n\n```go\ntype Repository struct {\n\tName  string\n\tOwner struct {\n\t\tLogin string\n\t}\n\tNameWithOwner string\n\tURL           string\n\tForkCount     int64\n\tIsFork        bool\n\tIsMirror      bool\n\tIsPrivate     bool\n\tCreatedAt     githubv4.DateTime\n}\n```\nRepository is a code repository\n\n```go\ntype SecurityAdvisory struct {\n\tDescription string\n\tCvss        CVSS\n\tPermalink   string\n\tSeverity    githubv4.SecurityAdvisorySeverity\n\tWithdrawnAt githubv4.DateTime\n}\n```\nSecurityAdvisory is the main security report for a vulnerability in a repository\n\n```go\ntype SecurityAdvisoryPackage struct {\n\tName string\n}\n```\nSecurityAdvisoryPackage is an object to share the name of the package that is impacted\n\n```go\ntype SecurityAdvisoryPackageVersion struct {\n\tIdentifier string\n}\n```\nSecurityAdvisoryPackageVersion is a struct with an identifier to identify the package\n\n```go\ntype Stargazer struct {\n\tStarredAt githubv4.DateTime\n\tNode      models.User\n}\n```\nStargazer a GitHub user tied to when they starred the repository\n\n```go\ntype StargazerWrapper struct {\n\tStargazer\n\tStarCount int64\n}\n```\nStargazerWrapper is a mapping of a GitHub stargazer to what the total count of stars roughly would've been when they starred the repository\n\n```go\ntype StargazersWrapper []StargazerWrapper\n```\nStargazersWrapper is a list of GitHub wrapped stargazers\n\n```go\nfunc GetStargazers(ctx context.Context, client models.Client, opts models.ListStargazersOptions, timeRange backend.TimeRange) (StargazersWrapper, error)\n```\nGetStargazers gets all stargazers for a GitHub repository\n\n```go\nfunc (a StargazersWrapper) Frames() data.Frames\n```\nFrames converts the list of stargazers to a Grafana DataFrame\n\n```go\ntype Tags []tagDTO\n```\nTags is a list of GitHub tags\n\n```go\nfunc GetAllTags(ctx context.Context, client models.Client, opts models.ListTagsOptions) (Tags, error)\n```\nGetAllTags retrieves every tag from a repository\n\n```go\nfunc GetTagsInRange(ctx context.Context, client models.Client, opts models.ListTagsOptions, from time.Time, to time.Time) (Tags, error)\n```\nGetTagsInRange retrieves every tag from the repository and then returns the ones that fall within the given time range.\n\n```go\nfunc (t Tags) Frames() data.Frames\n```\nFrames converts the list of tags to a Grafana DataFrame\n\n```go\ntype Users []models.User\n```\nUsers is a slice of GitHub users\n\n```go\nfunc GetAllContributors(ctx context.Context, client models.Client, opts models.ListContributorsOptions) (Users, error)\n```\nGetAllContributors lists all of the git contributors in a a repository\n\n```go\nfunc (u Users) Frames() data.Frames\n```\nFrames converts the list of GitHub users to a Grafana Data Frame\n\n```go\ntype Vulnerabilities []Vulnerability\n```\nVulnerabilities is a list of GitHub vulnerabilities\n\n```go\nfunc GetAllVulnerabilities(ctx context.Context, client models.Client, opts models.ListVulnerabilitiesOptions) (Vulnerabilities, error)\n```\nGetAllVulnerabilities gets all vulnerabilities from a GitHub repository\n\n```go\nfunc (a Vulnerabilities) Frames() data.Frames\n```\nFrames converts the list of vulnerabilities to a Grafana DataFrame\n\n```go\ntype Vulnerability struct {\n\tCreatedAt             githubv4.DateTime\n\tDismissedAt           githubv4.DateTime\n\tDismissReason         string\n\tSecurityVulnerability securityVulnerability\n\tState                 string\n}\n```\nVulnerability is used to collect Vulnerability information about GitHub\n\n```go\ntype WorkflowUsageWrapper models.WorkflowUsage\n```\nWorkflowUsageWrapper is wraps the workflow usage.\n\n```go\nfunc GetWorkflowUsage(ctx context.Context, client models.Client, opts models.WorkflowUsageOptions, timeRange backend.TimeRange) (WorkflowUsageWrapper, error)\n```\nGetWorkflowUsage return the usage for a specific workflow.\n\n```go\nfunc (usage WorkflowUsageWrapper) Frames() data.Frames\n```\nFrames converts the workflow usage to a Grafana DataFrame\n\n```go\ntype WorkflowsWrapper []*googlegithub.Workflow\n```\nWorkflowsWrapper is a list of GitHub workflows\n\n```go\nfunc GetWorkflows(ctx context.Context, client models.Client, opts models.ListWorkflowsOptions, timeRange backend.TimeRange) (WorkflowsWrapper, error)\n```\nGetWorkflows gets all workflows for a GitHub repository\n\n```go\nfunc (workflows WorkflowsWrapper) Frames() data.Frames\n```\nFrames converts the list of workflows to a Grafana DataFrame\n\n","path":"github.com/grafana/github-datasource/pkg/github","name":"github","synopsis":"Package github contains more usable functions and types for interacting with the GitHubv4 API","isRedistributable":true}
