query

package
v0.0.0-...-7e19965 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const TimeFormat = time.RFC3339

Variables

This section is empty.

Functions

func WithFrom

func WithFrom(from time.Time) func(Parameter)

func WithUserName

func WithUserName(userName string) func(Parameter)

Types

type Client

type Client struct {
	GQL api.GQLClient
}

func NewClient

func NewClient(
	gql api.GQLClient,
) *Client

func (*Client) ClosedIssues

func (c *Client) ClosedIssues(
	userName string,
	from time.Time,
	limit int,
) ([]Issue, error)

func (*Client) MergedPullRequests

func (c *Client) MergedPullRequests(
	userName string,
	from time.Time,
	limit int,
) ([]PullRequest, error)

func (*Client) Paginate

func (c *Client) Paginate(
	name string,
	query interface{},
	variables map[string]interface{},
	each func() (PageInfo, int),
	limit int,
) error

func (*Client) ReportedIssues

func (c *Client) ReportedIssues(
	userName string,
	from time.Time,
	limit int,
) ([]Issue, error)

func (*Client) ReviewedPullRequests

func (c *Client) ReviewedPullRequests(
	userName string,
	from time.Time,
	limit int,
) ([]PullRequest, error)

func (*Client) ViewerName

func (c *Client) ViewerName(userName string) (string, error)

type ClosedIssues

type ClosedIssues struct {
	User struct {
		Issues struct {
			Nodes    []Issue
			PageInfo PageInfo
		} `` /* 153-byte string literal not displayed */
	} `graphql:"user(login: $userName)"`
}

type DateTime

type DateTime string

type Issue

type Issue struct {
	model.IssuePrimitive
	Labels Labels `graphql:"labels(first: 10)"`
}

type Labels

type Labels struct {
	Nodes []struct {
		Name string `json:"name"`
	}
}

type MergedPullRequests

type MergedPullRequests struct {
	Search struct {
		Nodes []struct {
			PullRequest `graphql:"... on PullRequest"`
		}
		PageInfo PageInfo
	} `graphql:"search(query: $searchQuery, type: ISSUE, first: $limit, after: $after)"`
}

type PageInfo

type PageInfo struct {
	EndCursor   string `json:"end_cursor"`
	HasNextPage bool   `json:"has_next_page"`
}

type Parameter

type Parameter map[string]interface{}

func NewParameter

func NewParameter(opts ...func(Parameter)) Parameter

type PullRequest

type PullRequest struct {
	model.PullRequestPrimitive
	Labels Labels `graphql:"labels(first: 10)"`
}

type ReportedIssues

type ReportedIssues struct {
	User struct {
		Issues struct {
			Nodes    []Issue
			PageInfo PageInfo
		} `` /* 138-byte string literal not displayed */
	} `graphql:"user(login: $userName)"`
}

type ReviewedPullRequests

type ReviewedPullRequests struct {
	Search struct {
		Nodes []struct {
			PullRequest `graphql:"... on PullRequest"`
		}
		PageInfo PageInfo
	} `graphql:"search(query: $searchQuery, type: ISSUE, first: $limit, after: $after)"`
}

type ViewerName

type ViewerName struct {
	Viewer struct {
		Login string
	}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL