Documentation ¶
Index ¶
- type OrgUtils
- func (ot *OrgUtils) ConcealMembership(org, user string) (*github.Response, error)
- func (ot *OrgUtils) Edit(name string, org *github.Organization) (*github.Organization, *github.Response, error)
- func (ot *OrgUtils) EditOrgMembership(org string, membership *github.Membership) (*github.Membership, *github.Response, error)
- func (ot *OrgUtils) Get(org string) (*github.Organization, *github.Response, error)
- func (ot *OrgUtils) GetOrgMembership(org string) (*github.Membership, *github.Response, error)
- func (ot *OrgUtils) IsMember(org, user string) (bool, *github.Response, error)
- func (ot *OrgUtils) IsPublicMember(org, user string) (bool, *github.Response, error)
- func (ot *OrgUtils) List(user string, opt *github.ListOptions) ([]github.Organization, *github.Response, error)
- func (ot *OrgUtils) ListMembers(org string, opt *github.ListMembersOptions) ([]github.User, *github.Response, error)
- func (ot *OrgUtils) ListOrgMemberships(opt *github.ListOrgMembershipsOptions) ([]github.Membership, *github.Response, error)
- func (ot *OrgUtils) PublicizeMembership(org, user string) (*github.Response, error)
- func (ot *OrgUtils) RemoveMember(org, user string) (*github.Response, error)
- type RepoUtils
- func (rt *RepoUtils) AddCollaborator(owner, repo, user string) (*Response, error)
- func (rt *RepoUtils) CompareCommits(owner, repo string, base, head string) (*github.CommitsComparison, *Response, error)
- func (rt *RepoUtils) Create(org string, repo *github.Repository) (*github.Repository, *Response, error)
- func (rt *RepoUtils) CreateComment(owner, repo, sha string, comment *github.RepositoryComment) (*github.RepositoryComment, *Response, error)
- func (rt *RepoUtils) CreateFile(owner, repo, path string, opt *github.RepositoryContentFileOptions) (*github.RepositoryContentResponse, *Response, error)
- func (rt *RepoUtils) CreateFork(owner, repo string, opt *github.RepositoryCreateForkOptions) (*github.Repository, *Response, error)
- func (rt *RepoUtils) Delete(owner, repo string) (*Response, error)
- func (rt *RepoUtils) DeleteComment(owner, repo string, id int) (*Response, error)
- func (rt *RepoUtils) DeleteFile(owner, repo, path string, opt *github.RepositoryContentFileOptions) (*github.RepositoryContentResponse, *Response, error)
- func (rt *RepoUtils) Edit(owner, repo string, repository *github.Repository) (*github.Repository, *Response, error)
- func (rt *RepoUtils) Get(owner, repo string) (*github.Repository, *Response, error)
- func (rt *RepoUtils) GetBranch(owner, repo, branch string) (*github.Branch, *Response, error)
- func (rt *RepoUtils) GetComment(owner, repo string, id int) (*github.RepositoryComment, *Response, error)
- func (rt *RepoUtils) GetCommit(owner, repo, sha string) (*github.RepositoryCommit, *Response, error)
- func (rt *RepoUtils) GetContents(owner, repo, path string, opt *github.RepositoryContentGetOptions) (fileContent *github.RepositoryContent, ...)
- func (rt *RepoUtils) GetReadme(owner, repo string, opt *github.RepositoryContentGetOptions) (*github.RepositoryContent, *Response, error)
- func (rt *RepoUtils) IsCollaborator(owner, repo, user string) (bool, *Response, error)
- func (rt *RepoUtils) List(user string, opt *github.RepositoryListOptions) ([]github.Repository, *Response, error)
- func (rt *RepoUtils) ListAll(opt *github.RepositoryListAllOptions) ([]github.Repository, *Response, error)
- func (rt *RepoUtils) ListBranches(owner string, repo string, opt *github.ListOptions) ([]github.Branch, *Response, error)
- func (rt *RepoUtils) ListByOrg(org string, opt *github.RepositoryListByOrgOptions) ([]github.Repository, *Response, error)
- func (rt *RepoUtils) ListCollaborators(owner, repo string, opt *github.ListOptions) ([]github.User, *Response, error)
- func (rt *RepoUtils) ListComments(owner, repo string, opt *github.ListOptions) ([]github.RepositoryComment, *Response, error)
- func (rt *RepoUtils) ListCommitComments(owner, repo, sha string, opt *github.ListOptions) ([]github.RepositoryComment, *Response, error)
- func (rt *RepoUtils) ListCommits(owner, repo string, opt *github.CommitsListOptions) ([]github.RepositoryCommit, *Response, error)
- func (rt *RepoUtils) ListContributors(owner string, repository string, opt *github.ListContributorsOptions) ([]github.Contributor, *Response, error)
- func (rt *RepoUtils) ListForks(owner, repo string, opt *github.RepositoryListForksOptions) ([]github.Repository, *Response, error)
- func (rt *RepoUtils) ListLanguages(owner string, repo string) (map[string]int, *Response, error)
- func (rt *RepoUtils) ListTags(owner string, repo string, opt *github.ListOptions) ([]github.RepositoryTag, *Response, error)
- func (rt *RepoUtils) ListTeams(owner string, repo string, opt *github.ListOptions) ([]github.Team, *Response, error)
- func (rt *RepoUtils) RemoveCollaborator(owner, repo, user string) (*Response, error)
- func (rt *RepoUtils) UpdateComment(owner, repo string, id int, comment *github.RepositoryComment) (*github.RepositoryComment, *Response, error)
- func (rt *RepoUtils) UpdateFile(owner, repo, path string, opt *github.RepositoryContentFileOptions) (*github.RepositoryContentResponse, *Response, error)
- type Response
- type Team
- type TeamUtils
- func (tt *TeamUtils) AddTeamMember(team int, user string) (*github.Response, error)
- func (tt *TeamUtils) AddTeamMembership(team int, user string) (*github.Membership, *github.Response, error)
- func (tt *TeamUtils) AddTeamRepo(team int, owner string, repo string) (*github.Response, error)
- func (tt *TeamUtils) CreateTeam(org string, team *github.Team) (*github.Team, *Response, error)
- func (tt *TeamUtils) DeleteTeam(team int) (*github.Response, error)
- func (tt *TeamUtils) EditTeam(id int, team *github.Team) (*github.Team, *github.Response, error)
- func (tt *TeamUtils) GetTeam(team int) (*github.Team, *Response, error)
- func (tt *TeamUtils) GetTeamMembership(team int, user string) (*github.Membership, *github.Response, error)
- func (tt *TeamUtils) IsTeamMember(team int, user string) (bool, *github.Response, error)
- func (tt *TeamUtils) IsTeamRepo(team int, owner string, repo string) (bool, *github.Response, error)
- func (tt *TeamUtils) ListTeamMembers(team int, opt *github.ListOptions) ([]github.User, *github.Response, error)
- func (tt *TeamUtils) ListTeamRepos(team int, opt *github.ListOptions) ([]github.Repository, *github.Response, error)
- func (tt *TeamUtils) ListTeams(org string, opt *github.ListOptions) ([]github.Team, *Response, error)
- func (tt *TeamUtils) RemoveTeamMember(team int, user string) (*github.Response, error)
- func (tt *TeamUtils) RemoveTeamMembership(team int, user string) (*github.Response, error)
- func (tt *TeamUtils) RemoveTeamRepo(team int, owner string, repo string) (*github.Response, error)
- type User
- type UserUtils
- type Utils
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OrgUtils ¶
type OrgUtils struct {
*Utils
}
OrgUtils handles activities around GitHub organizations. This code is basically just a wrapper around the library that google has graciously put together.
TODO: Methods implemented on this struct should provide generic return values (Not, the go-github structs)
func (*OrgUtils) ConcealMembership ¶
ConcealMembership conceals a user's membership in an organization.
func (*OrgUtils) Edit ¶
func (ot *OrgUtils) Edit(name string, org *github.Organization) (*github.Organization, *github.Response, error)
Edit an organization.
func (*OrgUtils) EditOrgMembership ¶
func (ot *OrgUtils) EditOrgMembership(org string, membership *github.Membership) (*github.Membership, *github.Response, error)
EditOrgMembership edits the membership for the authenticated user for the specified organization.
func (*OrgUtils) GetOrgMembership ¶
GetOrgMembership gets the membership for the authenticated user for the specified organization.
func (*OrgUtils) IsPublicMember ¶
IsPublicMember checks if a user is a public member of an organization.
func (*OrgUtils) List ¶
func (ot *OrgUtils) List(user string, opt *github.ListOptions) ([]github.Organization, *github.Response, error)
List the organizations for a user. Passing the empty string will list organizations for the authenticated user.
func (*OrgUtils) ListMembers ¶
func (ot *OrgUtils) ListMembers(org string, opt *github.ListMembersOptions) ([]github.User, *github.Response, error)
ListMembers lists the members for an organization. If the authenticated user is an owner of the organization, this will return both concealed and public members, otherwise it will only return public members.
func (*OrgUtils) ListOrgMemberships ¶
func (ot *OrgUtils) ListOrgMemberships(opt *github.ListOrgMembershipsOptions) ([]github.Membership, *github.Response, error)
ListOrgMemberships lists the organization memberships for the authenticated user.
func (*OrgUtils) PublicizeMembership ¶
PublicizeMembership publicizes a user's membership in an organization.
type RepoUtils ¶
type RepoUtils struct {
*Utils
}
RepoUtils handles activities around GitHub repositories. This code is basically just a wrapper around the library that google has graciously put together.
TODO: Methods implemented on this struct should provide generic return values (Not, the go-github structs)
func (*RepoUtils) AddCollaborator ¶
AddCollaborator adds the specified Github user as collaborator to the given repo.
func (*RepoUtils) CompareCommits ¶
func (rt *RepoUtils) CompareCommits(owner, repo string, base, head string) (*github.CommitsComparison, *Response, error)
CompareCommits compares a range of commits with each other. todo: support media formats - https://github.com/google/go-github/issues/6
func (*RepoUtils) Create ¶
func (rt *RepoUtils) Create(org string, repo *github.Repository) (*github.Repository, *Response, error)
Create a new repository. If an organization is specified, the new repository will be created under that org. If the empty string is specified, it will be created for the authenticated user.
func (*RepoUtils) CreateComment ¶
func (rt *RepoUtils) CreateComment(owner, repo, sha string, comment *github.RepositoryComment) (*github.RepositoryComment, *Response, error)
CreateComment creates a comment for the given commit. Note: GitHub allows for comments to be created for non-existing files and positions.
func (*RepoUtils) CreateFile ¶
func (rt *RepoUtils) CreateFile(owner, repo, path string, opt *github.RepositoryContentFileOptions) (*github.RepositoryContentResponse, *Response, error)
CreateFile creates a new file in a repository at the given path and returns the commit and file metadata.
func (*RepoUtils) CreateFork ¶
func (rt *RepoUtils) CreateFork(owner, repo string, opt *github.RepositoryCreateForkOptions) (*github.Repository, *Response, error)
CreateFork creates a fork of the specified repository.
func (*RepoUtils) DeleteComment ¶
func (*RepoUtils) DeleteFile ¶
func (rt *RepoUtils) DeleteFile(owner, repo, path string, opt *github.RepositoryContentFileOptions) (*github.RepositoryContentResponse, *Response, error)
DeleteFile deletes a file from a repository and returns the commit. Requires the blob SHA of the file to be deleted.
func (*RepoUtils) Edit ¶
func (rt *RepoUtils) Edit(owner, repo string, repository *github.Repository) (*github.Repository, *Response, error)
Edit updates a repository.
func (*RepoUtils) GetComment ¶
func (rt *RepoUtils) GetComment(owner, repo string, id int) (*github.RepositoryComment, *Response, error)
GetComment gets a single comment from a repository.
func (*RepoUtils) GetCommit ¶
func (rt *RepoUtils) GetCommit(owner, repo, sha string) (*github.RepositoryCommit, *Response, error)
GetCommit fetches the specified commit, including all details about it. todo: support media formats - https://github.com/google/go-github/issues/6
func (*RepoUtils) GetContents ¶
func (rt *RepoUtils) GetContents(owner, repo, path string, opt *github.RepositoryContentGetOptions) (fileContent *github.RepositoryContent, directoryContent []*github.RepositoryContent, resp *Response, err error)
GetContents can return either the metadata and content of a single file (when path references a file) or the metadata of all the files and/or subdirectories of a directory (when path references a directory). To make it easy to distinguish between both result types and to mimic the API as much as possible, both result types will be returned but only one will contain a value and the other will be nil.
func (*RepoUtils) GetReadme ¶
func (rt *RepoUtils) GetReadme(owner, repo string, opt *github.RepositoryContentGetOptions) (*github.RepositoryContent, *Response, error)
GetReadme gets the Readme file for the repository.
func (*RepoUtils) IsCollaborator ¶
IsCollaborator checks whether the specified Github user has collaborator access to the given repo. Note: This will return false if the user is not a collaborator OR the user is not a GitHub user.
func (*RepoUtils) List ¶
func (rt *RepoUtils) List(user string, opt *github.RepositoryListOptions) ([]github.Repository, *Response, error)
List the repositories for a user. Passing the empty string will list repositories for the authenticated user.
func (*RepoUtils) ListAll ¶
func (rt *RepoUtils) ListAll(opt *github.RepositoryListAllOptions) ([]github.Repository, *Response, error)
ListAll lists all GitHub repositories in the order that they were created.
func (*RepoUtils) ListBranches ¶
func (rt *RepoUtils) ListBranches(owner string, repo string, opt *github.ListOptions) ([]github.Branch, *Response, error)
ListBranches lists branches for the specified repository.
func (*RepoUtils) ListByOrg ¶
func (rt *RepoUtils) ListByOrg(org string, opt *github.RepositoryListByOrgOptions) ([]github.Repository, *Response, error)
ListByOrg lists the repositories for an organization.
func (*RepoUtils) ListCollaborators ¶
func (rt *RepoUtils) ListCollaborators(owner, repo string, opt *github.ListOptions) ([]github.User, *Response, error)
ListCollaborators lists the Github users that have access to the repository.
func (*RepoUtils) ListComments ¶
func (rt *RepoUtils) ListComments(owner, repo string, opt *github.ListOptions) ([]github.RepositoryComment, *Response, error)
ListComments lists all the comments for the repository.
func (*RepoUtils) ListCommitComments ¶
func (rt *RepoUtils) ListCommitComments(owner, repo, sha string, opt *github.ListOptions) ([]github.RepositoryComment, *Response, error)
ListCommitComments lists all the comments for a given commit SHA.
func (*RepoUtils) ListCommits ¶
func (rt *RepoUtils) ListCommits(owner, repo string, opt *github.CommitsListOptions) ([]github.RepositoryCommit, *Response, error)
ListCommits lists the commits of a repository.
func (*RepoUtils) ListContributors ¶
func (rt *RepoUtils) ListContributors(owner string, repository string, opt *github.ListContributorsOptions) ([]github.Contributor, *Response, error)
ListContributors lists contributors for a repository
func (*RepoUtils) ListForks ¶
func (rt *RepoUtils) ListForks(owner, repo string, opt *github.RepositoryListForksOptions) ([]github.Repository, *Response, error)
ListForks lists the forks of the specified repository.
func (*RepoUtils) ListLanguages ¶
ListLanguages lists languages for the specified repository. The returned map specifies the languages and the number of bytes of code written in that language. For example:
{ "C": 78769, "Python": 7769 }
func (*RepoUtils) ListTags ¶
func (rt *RepoUtils) ListTags(owner string, repo string, opt *github.ListOptions) ([]github.RepositoryTag, *Response, error)
ListTags lists tags for the specified repository.
func (*RepoUtils) ListTeams ¶
func (rt *RepoUtils) ListTeams(owner string, repo string, opt *github.ListOptions) ([]github.Team, *Response, error)
ListTeams lists the teams for the specified repository.
func (*RepoUtils) RemoveCollaborator ¶
RemoveCollaborator removes the specified Github user as collaborator from the given repo. Note: Does not return error if a valid user that is not a collaborator is removed.
func (*RepoUtils) UpdateComment ¶
func (rt *RepoUtils) UpdateComment(owner, repo string, id int, comment *github.RepositoryComment) (*github.RepositoryComment, *Response, error)
UpdateComment updates the body of a single comment.
func (*RepoUtils) UpdateFile ¶
func (rt *RepoUtils) UpdateFile(owner, repo, path string, opt *github.RepositoryContentFileOptions) (*github.RepositoryContentResponse, *Response, error)
UpdateFile updates a file in a repository at the given path and returns the commit and file metadata. Requires the blob SHA of the file being updated.
type Response ¶
Response is a light wrapper around the go-github Response struct
func NewResponse ¶
NewResponse creates a new instance of Response
type Team ¶
Team represents a team within a GitHub organization. Teams are used to manage access to an organization's repositories.
This is just a thin wrapper around the go-github Team struct
type TeamUtils ¶
type TeamUtils struct {
*Utils
}
TeamUtils handles activities around managing teams within a GitHub organization. This code is basically just a wrapper around the library that google has graciously put together.
TODO: Methods implemented on this struct should provide generic return values (Not, the go-github structs)
func (*TeamUtils) AddTeamMember ¶
AddTeamMember adds a user to a team.
func (*TeamUtils) AddTeamMembership ¶
func (tt *TeamUtils) AddTeamMembership(team int, user string) (*github.Membership, *github.Response, error)
AddTeamMembership adds or invites a user to a team.
In order to add a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with.
If the user is already a part of the team's organization (meaning they're on at least one other team in the organization), this endpoint will add the user to the team.
If the user is completely unaffiliated with the team's organization (meaning they're on none of the organization's teams), this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team.
func (*TeamUtils) AddTeamRepo ¶
AddTeamRepo adds a repository to be managed by the specified team. The specified repository must be owned by the organization to which the team belongs, or a direct fork of a repository owned by the organization.
func (*TeamUtils) CreateTeam ¶
CreateTeam creates a new team within an organization.
func (*TeamUtils) DeleteTeam ¶
DeleteTeam deletes a team.
func (*TeamUtils) GetTeamMembership ¶
func (tt *TeamUtils) GetTeamMembership(team int, user string) (*github.Membership, *github.Response, error)
GetTeamMembership returns the membership status for a user in a team.
func (*TeamUtils) IsTeamMember ¶
IsTeamMember checks if a user is a member of the specified team.
func (*TeamUtils) IsTeamRepo ¶
func (tt *TeamUtils) IsTeamRepo(team int, owner string, repo string) (bool, *github.Response, error)
IsTeamRepo checks if a team manages the specified repository.
func (*TeamUtils) ListTeamMembers ¶
func (tt *TeamUtils) ListTeamMembers(team int, opt *github.ListOptions) ([]github.User, *github.Response, error)
ListTeamMembers lists all of the users who are members of the specified team.
func (*TeamUtils) ListTeamRepos ¶
func (tt *TeamUtils) ListTeamRepos(team int, opt *github.ListOptions) ([]github.Repository, *github.Response, error)
ListTeamRepos lists the repositories that the specified team has access to.
func (*TeamUtils) ListTeams ¶
func (tt *TeamUtils) ListTeams(org string, opt *github.ListOptions) ([]github.Team, *Response, error)
ListTeams lists all of the teams for an organization.
func (*TeamUtils) RemoveTeamMember ¶
RemoveTeamMember removes a user from a team.
func (*TeamUtils) RemoveTeamMembership ¶
RemoveTeamMembership removes a user from a team.
type UserUtils ¶
type UserUtils struct {
*Utils
}
UserUtils handles activities around managing users in a development workflow. This could include things like:
- communication with the user related methods of the GitHub API. Note: GitHub API docs: http://developer.github.com/v3/users/
func (*UserUtils) GetGitHubUser ¶
GetGitHubUser fetches a repository user. Passing the empty string will fetch the authenticated user. TODO: This should provide generic return values (Not, the go-github structs)