graphql

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	Login    string
	Typename string `graphql:"__typename"`
	User     `graphql:"... on User"`
}

type ClosedByConnection

type ClosedByConnection struct {
	Nodes []struct {
		ClosedEvent struct {
			Actor Actor // closed_by_id bigint NOT NULL, closed_by_login text NOT NULL,
		} `graphql:"... on ClosedEvent"`
	}

} // `graphql:"timelineItems(last:1, itemTypes:CLOSED_EVENT)"`

type Connection

type Connection struct {
	PageInfo   PageInfo
	TotalCount int
}

Connection represents common fields for paginated the connections

func (Connection) GetPageInfo

func (c Connection) GetPageInfo() PageInfo

func (Connection) GetTotalCount

func (c Connection) GetTotalCount() int

type Issue

type Issue struct {
	IssueFields
	Assignees UserConnection          `graphql:"assignees(first: $assigneesPage, after: $assigneesCursor)"`
	Labels    LabelConnection         `graphql:"labels(first: $labelsPage, after: $labelsCursor)"`
	Comments  IssueCommentsConnection `graphql:"comments(first: $issueCommentsPage, after: $issueCommentsCursor)"`
	ClosedBy  ClosedByConnection      `graphql:"timelineItems(last:1, itemTypes:CLOSED_EVENT)"`

} // `graphql:"issue(number: $issueNumber)"`

Issue represents https://developer.github.com/v4/object/issue/

type IssueComment

type IssueComment struct {
	AuthorAssociation string    // author_association text,
	Body              string    // body text,
	CreatedAt         time.Time // created_at timestamptz,
	URL               string    // htmlurl text,
	DatabaseID        int       // id bigint,
	ID                string    // node_id text,
	UpdatedAt         string    // updated_at timestamptz,
	Author            Actor     // user_id bigint NOT NULL, user_login text NOT NULL,
}

type IssueCommentsConnection

type IssueCommentsConnection struct {
	Connection
	Nodes []IssueComment

} // `graphql:"comments(first: $issueCommentsPage, after: $issueCommentsCursor)"`

func (IssueCommentsConnection) Len

func (c IssueCommentsConnection) Len() int

type IssueConnection

type IssueConnection struct {
	Connection
	Nodes []Issue

} //`graphql:"issues(first: $issuesPage, after: $issuesCursor)"`

IssueConnection represents https://developer.github.com/v4/object/issueconnection/

func (IssueConnection) Len

func (c IssueConnection) Len() int

type IssueFields

type IssueFields struct {
	Body       string     // body text,
	ClosedAt   *time.Time // closed_at timestamptz,
	CreatedAt  time.Time  // created_at timestamptz,
	URL        string     // htmlurl text,
	DatabaseID int        // id bigint,
	Locked     bool       // locked boolean,
	Milestone  struct {
		ID    string // milestone_id text NOT NULL,
		Title string // milestone_title text NOT NULL,
	}
	ID        string    // node_id text,
	Number    int       // number bigint,
	State     string    // state text,
	Title     string    // title text,
	UpdatedAt time.Time // updated_at timestamptz,
	Author    Actor     // user_id bigint NOT NULL, user_login text NOT NULL,
}

type Label

type Label struct {
	Name string
}

Label represents https://developer.github.com/v4/object/label/

type LabelConnection

type LabelConnection struct {
	Connection
	Nodes []Label

} //`graphql:"labels(first: $labelsPage, after: $labelsCursor)"`

LabelConnection represents https://developer.github.com/v4/object/labelconnection/

func (LabelConnection) Len

func (c LabelConnection) Len() int

type Organization

type Organization struct {
	OrganizationFields
	MembersWithRole OrganizationMemberConnection `graphql:"membersWithRole(first: $membersWithRolePage, after: $membersWithRoleCursor)"`

} // `graphql:"organization(login: $organizationLogin)"`

Organization represents https://developer.github.com/v4/object/organization/

type OrganizationFields

type OrganizationFields struct {
	AvatarURL         string    // avatar_url text,
	CreatedAt         time.Time // created_at timestamptz,
	Description       string    // description text,
	Email             string    // email text,
	URL               string    // htmlurl text,
	DatabaseID        int       // id bigint,
	Login             string    // login text,
	Name              string    // name text,
	ID                string    // node_id text,
	OwnedPrivateRepos struct {
		TotalCount int // owned_private_repos bigint,
	} `graphql:"owned_private_repos: repositories(privacy:PRIVATE, ownerAffiliations:OWNER)"`
	PublicRepos struct {
		TotalCount int // public_repos bigint,
	} `graphql:"public_repos: repositories(privacy:PUBLIC)"`
	TotalPrivateRepos struct {
		TotalCount int // total_private_repos bigint,
	} `graphql:"total_private_repos: repositories(privacy:PRIVATE)"`
	UpdatedAt string // updated_at timestamptz,
}

OrganizationFields defines the fields for Organization https://developer.github.com/v4/object/organization/

type OrganizationMemberConnection

type OrganizationMemberConnection struct {
	Connection
	Nodes []UserExtended

} // `graphql:"membersWithRole(first: $membersWithRolePage, after: $membersWithRoleCursor)"`

OrganizationMemberConnection represents https://developer.github.com/v4/object/organizationmemberconnection/

func (OrganizationMemberConnection) Len

type PageInfo

type PageInfo struct {
	HasNextPage bool
	EndCursor   string
}

PageInfo represents https://developer.github.com/v4/object/pageinfo/

type PullRequest

type PullRequest struct {
	PullRequestFields
	Assignees UserConnection              `graphql:"assignees(first: $assigneesPage, after: $assigneesCursor)"`
	Labels    LabelConnection             `graphql:"labels(first: $labelsPage, after: $labelsCursor)"`
	Comments  IssueCommentsConnection     `graphql:"comments(first: $issueCommentsPage, after: $issueCommentsCursor)"`
	Reviews   PullRequestReviewConnection `graphql:"reviews(first: $pullRequestReviewsPage, after: $pullRequestReviewsCursor)"`

} // `graphql:"pullRequest(number: $prNumber)"`

type PullRequestConnection

type PullRequestConnection struct {
	Connection
	Nodes []PullRequest

} //`graphql:"pullRequests(first: $pullRequestsPage, after: $pullRequestsCursor)"`

func (PullRequestConnection) Len

func (c PullRequestConnection) Len() int

type PullRequestFields

type PullRequestFields struct {
	Additions         int        // additions bigint,
	AuthorAssociation string     // author_association text,
	BaseRef           Ref        // base_*
	Body              string     // body text,
	ChangedFiles      int        // changed_files bigint,
	ClosedAt          *time.Time // closed_at timestamptz,
	Commits           struct {
		TotalCount int // commits bigint,
	}
	CreatedAt           time.Time // created_at timestamptz,
	Deletions           int       // deletions bigint,
	HeadRef             Ref       // head_*
	URL                 string    // htmlurl text,
	DatabaseID          int       // id bigint,
	MaintainerCanModify bool      // maintainer_can_modify boolean,
	MergeCommit         struct {
		Oid string // merge_commit_sha text,
	}
	Mergeable string     // mergeable boolean,
	Merged    bool       // merged boolean,
	MergedAt  *time.Time // merged_at timestamptz,
	MergedBy  Actor      // merged_by_id bigint NOT NULL, merged_by_login text NOT NULL,
	Milestone struct {
		ID    string // milestone_id text NOT NULL,
		Title string // milestone_title text NOT NULL,
	}
	ID            string // node_id text,
	Number        int    // number bigint,
	ReviewThreads struct {
		TotalCount int // review_comments bigint,
	}
	State     string // state text,
	Title     string // title text,
	UpdatedAt string // updated_at timestamptz,
	Author    Actor  // user_id bigint NOT NULL, user_login text NOT NULL,
}

type PullRequestReview

type PullRequestReview struct {
	PullRequestReviewFields
	Comments PullRequestReviewCommentConnection `graphql:"comments(first: $pullRequestReviewCommentsPage, after: $pullRequestReviewCommentsCursor)"`
}

type PullRequestReviewComment

type PullRequestReviewComment struct {
	AuthorAssociation string // author_association text,
	Body              string // body text,
	Commit            struct {
		Oid string // commit_id text,
	}
	CreatedAt  time.Time // created_at timestamptz,
	DiffHunk   string    // diff_hunk text,
	URL        string    // htmlurl text,
	DatabaseID int       // id bigint,
	//in_reply_to            string    // in_reply_to bigint,
	ID             string // node_id text,
	OriginalCommit struct {
		Oid string // original_commit_id text,
	}
	OriginalPosition int       // original_position bigint,
	Path             string    // path text,
	Position         int       // position bigint,
	UpdatedAt        time.Time // updated_at timestamptz,
	Author           Actor     // user_id bigint NOT NULL, user_login text NOT NULL,
}

type PullRequestReviewCommentConnection

type PullRequestReviewCommentConnection struct {
	Connection
	Nodes []PullRequestReviewComment
}

func (PullRequestReviewCommentConnection) Len

type PullRequestReviewConnection

type PullRequestReviewConnection struct {
	Connection
	Nodes []PullRequestReview

} // `graphql:"reviews(first: $pullRequestReviewsPage, after: $pullRequestReviewsCursor)"`

func (PullRequestReviewConnection) Len

type PullRequestReviewFields

type PullRequestReviewFields struct {
	Body   string // body text,
	Commit struct {
		Oid string // commit_id text,
	}
	URL         string    // htmlurl text,
	DatabaseID  int       // id bigint,
	ID          string    // node_id text,
	State       string    // state text,
	SubmittedAt time.Time // submitted_at timestamptz,
	Author      Actor     // user_id bigint NOT NULL, user_login text NOT NULL,

	Comments PullRequestReviewCommentConnection `graphql:"comments(first: $pullRequestReviewCommentsPage, after: $pullRequestReviewCommentsCursor)"`
}

type Ref

type Ref struct {
	Name       string // _ref text
	Repository struct {
		Name  string // _repository_name text
		Owner struct {
			Login string // _repository_owner text
		}
	}
	Target struct {
		Oid    string //_sha
		Commit struct {
			Author struct {
				User struct {
					Login string // _user
				}
			}
		} `graphql:"... on Commit"`
	}
}

type Repository

type Repository struct {
	RepositoryFields
	RepositoryTopics RepositoryTopicsConnection `graphql:"repositoryTopics(first: $repositoryTopicsPage, after: $repositoryTopicsCursor)"`
	Issues           IssueConnection            `graphql:"issues(first: $issuesPage, after: $issuesCursor)"`
	PullRequests     PullRequestConnection      `graphql:"pullRequests(first: $pullRequestsPage, after: $pullRequestsCursor)"`

} // `graphql:"repository(owner: $owner, name: $name)"`

Repository represents https://developer.github.com/v4/object/repository/

type RepositoryFields

type RepositoryFields struct {
	MergeCommitAllowed bool      // allow_merge_commit boolean
	RebaseMergeAllowed bool      // allow_rebase_merge boolean
	SquashMergeAllowed bool      // allow_squash_merge boolean
	IsArchived         bool      // archived boolean
	CreatedAt          time.Time // created_at timestamptz
	DefaultBranchRef   struct {
		Name string // default_branch text
	}
	Description      string // description text
	IsDisabled       bool   // disabled boolean
	IsFork           bool   // fork boolean
	ForkCount        int    // forks_count bigint
	NameWithOwner    string // full_name text
	HasIssuesEnabled bool   // has_issues boolean
	HasWikiEnabled   bool   // has_wiki boolean
	HomepageURL      string // homepage text
	URL              string // htmlurl text
	DatabaseID       int    // id bigint,
	PrimaryLanguage  struct {
		Name string // language text
	}
	Name       string // name text
	ID         string // node_id text
	OpenIssues struct {
		TotalCount int // open_issues_count bigint
	} `graphql:"openIssues: issues(states:[OPEN])"`
	Owner struct {
		Organization struct {
			DatabaseID int // owner_id bigint NOT NULL,
		} `graphql:"... on Organization"`
		User struct {
			DatabaseID int // owner_id bigint NOT NULL,
		} `graphql:"... on User"`
		Login    string // owner_login text NOT NULL,
		Typename string `graphql:"__typename"` // owner_type text NOT NULL
	}
	IsPrivate  bool      // private boolean
	PushedAt   time.Time // pushed_at timestamptz
	SSHURL     string    // sshurl text
	Stargazers struct {
		TotalCount int // stargazers_count bigint
	}
	UpdatedAt time.Time // updated_at timestamptz
	Watchers  struct {
		TotalCount int // watchers_count bigint
	}
}

RepositoryFields defines the fields for Repository https://developer.github.com/v4/object/repository/

type RepositoryTopicsConnection

type RepositoryTopicsConnection struct {
	Connection
	Nodes []struct {
		Topic struct {
			Name string
		}
	}

} //`graphql:"repositoryTopics(first: $repositoryTopicsPage, after: $repositoryTopicsCursor)"`

RepositoryTopicsConnection represents https://developer.github.com/v4/object/repositorytopicconnection/

func (RepositoryTopicsConnection) Len

type User

type User struct {
	DatabaseID int
	ID         string
	Login      string
}

User represents https://developer.github.com/v4/object/user/

type UserConnection

type UserConnection struct {
	Connection
	Nodes []User

} //`graphql:"assignees(first: $assigneesPage, after: $assigneesCursor)"`

UserConnection represents https://developer.github.com/v4/object/userconnection/

func (UserConnection) Len

func (c UserConnection) Len() int

type UserExtended

type UserExtended struct {
	AvatarURL string    // avatar_url text,
	Bio       string    // bio text,
	Company   string    // company text,
	CreatedAt time.Time // created_at timestamptz,
	// TODO requires ['user:email', 'read:user'] scopes
	//Email     string // email text,
	Followers struct {
		TotalCount int // followers bigint,
	}
	Following struct {
		TotalCount int // following bigint,
	}
	IsHireable        bool   // hireable boolean,
	URL               string // htmlurl text,
	DatabaseID        int    // id bigint,
	Location          string // location text,
	Login             string // login text,
	Name              string // name text,
	ID                string // node_id text,
	OwnedPrivateRepos struct {
		TotalCount int // owned_private_repos bigint,
	} `graphql:"owned_private_repos: repositories(privacy:PRIVATE, ownerAffiliations:OWNER)"`
	/*
		TODO: call returns: You don't have permission to see gists.
			PrivateGists struct {
				TotalCount int // private_gists bigint,
			} `graphql:"private_gists: gists(privacy:SECRET)"`
			PublicGists struct {
				TotalCount int // public_gists bigint,
			} `graphql:"public_gists: gists(privacy:PUBLIC)"`
	*/
	PublicRepos struct {
		TotalCount int // public_repos bigint,
	} `graphql:"public_repos: repositories(privacy:PUBLIC)"`
	TotalPrivateRepos struct {
		TotalCount int // total_private_repos bigint,
	} `graphql:"total_private_repos: repositories(privacy:PRIVATE)"`
	UpdatedAt time.Time // updated_at timestamptz,
}

UserExtended is the same type as User, but requesting more fields. Represents https://developer.github.com/v4/object/user/

Jump to

Keyboard shortcuts

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