graphql

package
v0.0.0-...-5f547a6 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContributionsQuery struct {
	User struct {
		ContributionsCollection ContributionsCollection `graphql:"contributionsCollection(from: $from, to: $to)"`
	} `graphql:"user(login: $user)"`
}
View Source
var OrganizationQuery struct {
	Organization struct {
		Login           string
		Name            string
		AvatarURL       string
		Location        string
		Email           string
		TwitterUsername string
		WebsiteURL      string
		Description     string
		CreatedAt       githubv4.DateTime
		Projects        struct {
			TotalCount int
		}
		Packages struct {
			TotalCount int
		}
		Repositories struct {
			TotalCount int
		} `graphql:"repositories(privacy: PUBLIC)"`
		MembersWithRole struct {
			TotalCount int
		} `graphql:"membersWithRole(first: 100)"`
		SponsorshipsAsSponsor struct {
			TotalCount int
		} `graphql:"sponsorshipsAsSponsor"`
		SponsorshipsAsMaintainer struct {
			TotalCount int
		} `graphql:"sponsorshipsAsMaintainer"`
	} `graphql:"organization(login: $user)"`
}
View Source
var UserQuery struct {
	User struct {
		Login           string
		Name            string
		AvatarURL       string
		Location        string
		Company         string
		Email           string
		TwitterUsername string
		WebsiteURL      string
		Bio             string
		Status          struct {
			Emoji   string
			Message string
		}
		CreatedAt githubv4.DateTime
		Followers struct {
			TotalCount int
		}
		Following struct {
			TotalCount int
		}
		StarredRepositories struct {
			TotalCount int
		}
		Projects struct {
			TotalCount int
		}
		Packages struct {
			TotalCount int
		}
		Watching struct {
			TotalCount int
		} `graphql:"watching(privacy: PUBLIC)"`
		Gists struct {
			TotalCount int
		} `graphql:"gists(privacy: PUBLIC)"`
		Repositories struct {
			TotalCount int
		} `graphql:"repositories(privacy: PUBLIC)"`
		Organizations struct {
			TotalCount int
		} `graphql:"organizations"`
		SponsorshipsAsSponsor struct {
			TotalCount int
		} `graphql:"sponsorshipsAsSponsor"`
		SponsorshipsAsMaintainer struct {
			TotalCount int
		} `graphql:"sponsorshipsAsMaintainer"`
	} `graphql:"user(login: $user)"`
}
View Source
var YearActivityQuery struct {
	User struct {
		Repositories struct {
			Nodes []Nodes
		} `graphql:"repositories(first: $repoCount, ownerAffiliations: OWNER)"`
		ContributionsCollection struct {
			ContributionCalendar ContributionCalendar
		} `graph:"contributionsCollection"`
	} `graphql:"user(login: $user)"`
}

Functions

func AuthGraphQL

func AuthGraphQL(token string) *githubv4.Client

func LanguagesByCommit

func LanguagesByCommit(client *githubv4.Client, user string, from int, to int) (
	languages []string,
	commitsNum []float64,
	err error,
)

func YearActivity

func YearActivity(client *githubv4.Client, user string) (dates []string, contribs []float64, err error)

Types

type AggregatedContributionsCollection

type AggregatedContributionsCollection struct {
	Repository             string
	CommitCount            int
	IssueCount             int
	PullRequestCount       int
	PullRequestReviewCount int
}

type CommitContributions

type CommitContributions struct {
	Contributions Contributions
	Repository    Repository
}

func AllCommits

func AllCommits(client *githubv4.Client, user string, fromYear int, toYear int) ([]CommitContributions, error)

type ContributionCalendar

type ContributionCalendar struct {
	Weeks []Weeks
}

type ContributionDays

type ContributionDays struct {
	Date              string
	ContributionCount int
}

type Contributions

type Contributions struct {
	TotalCount int
}

type ContributionsCollection

type ContributionsCollection struct {
	CommitContributionsByRepository            []CommitContributions
	IssueContributionsByRepository             []IssueContributions
	PullRequestContributionsByRepository       []PullRequestContributions
	PullRequestReviewContributionsByRepository []pullRequestReviewContributions
}

func AllContributions

func AllContributions(client *githubv4.Client, user string, fromYear int, toYear int) (c ContributionsCollection, err error)

type IssueContributions

type IssueContributions struct {
	Contributions Contributions
	Repository    Repository
}

func AllIssues

func AllIssues(client *githubv4.Client, user string, fromYear int, toYear int) ([]IssueContributions, error)

type Language

type Language struct {
	Name string
}

type Nodes

type Nodes struct {
	PrimaryLanguage struct {
		Name string
	}
	Watchers struct {
		TotalCount int
	}
	StarGazers struct {
		TotalCount int
	} `graphql:"stargazers"`
	Name      string
	ForkCount int
	Languages struct {
		TotalCount int
		Nodes      []Language
	} `graphql:"languages(first: $languageCount)"`
}

type Organization

type Organization struct {
	Login           string
	Name            string
	AvatarURL       string
	Location        string
	Email           string
	TwitterUsername string
	WebsiteURL      string
	Description     string
	CreatedAt       githubv4.DateTime
	Projects        struct {
		TotalCount int
	}
	Packages struct {
		TotalCount int
	}
	Repositories struct {
		TotalCount int
	} `graphql:"repositories(privacy: PUBLIC)"`
	MembersWithRole struct {
		TotalCount int
	} `graphql:"membersWithRole(first: 100)"`
	SponsorshipsAsSponsor struct {
		TotalCount int
	} `graphql:"sponsorshipsAsSponsor"`
	SponsorshipsAsMaintainer struct {
		TotalCount int
	} `graphql:"sponsorshipsAsMaintainer"`
}

func OrganizationDetails

func OrganizationDetails(client *githubv4.Client, organization string) (org Organization, err error)

type PullRequestContributions

type PullRequestContributions struct {
	Contributions Contributions
	Repository    Repository
}

func AllPullRequests

func AllPullRequests(client *githubv4.Client, user string, fromYear int, toYear int) ([]PullRequestContributions, error)

type Repository

type Repository struct {
	NameWithOwner   string
	PrimaryLanguage struct {
		Name string
	}
}

type User

type User struct {
	Login           string
	Name            string
	AvatarURL       string
	Location        string
	Company         string
	Email           string
	TwitterUsername string
	WebsiteURL      string
	Bio             string
	Status          struct {
		Emoji   string
		Message string
	}
	CreatedAt githubv4.DateTime
	Followers struct {
		TotalCount int
	}
	Following struct {
		TotalCount int
	}
	StarredRepositories struct {
		TotalCount int
	}
	Projects struct {
		TotalCount int
	}
	Packages struct {
		TotalCount int
	}
	Watching struct {
		TotalCount int
	} `graphql:"watching(privacy: PUBLIC)"`
	Gists struct {
		TotalCount int
	} `graphql:"gists(privacy: PUBLIC)"`
	Repositories struct {
		TotalCount int
	} `graphql:"repositories(privacy: PUBLIC)"`
	Organizations struct {
		TotalCount int
	} `graphql:"organizations"`
	SponsorshipsAsSponsor struct {
		TotalCount int
	} `graphql:"sponsorshipsAsSponsor"`
	SponsorshipsAsMaintainer struct {
		TotalCount int
	} `graphql:"sponsorshipsAsMaintainer"`
}

func UserDetails

func UserDetails(client *githubv4.Client, user string) (innerUser User, err error)

type Weeks

type Weeks struct {
	ContributionDays []ContributionDays
}

Jump to

Keyboard shortcuts

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