Documentation ¶
Index ¶
- Variables
- func AutoCompleteRepoName(repo string) string
- func Confirm(question string, def bool) bool
- func CurrentUserName() (string, bool)
- func FormatError(err *octokit.ResponseError) string
- func GetAllCollabs(url *RepoURL) ([]octokit.User, error)
- func GetAllTeamsForOrg(org string) ([]octokit.Team, error)
- func GetAllTeamsForRepo(url *RepoURL) ([]octokit.Team, error)
- func GetAllUserRepositories() ([]octokit.Repository, error)
- func GetAllUsersForOrg(org string) ([]octokit.User, error)
- func GetTeamByName(org, team string, logger pine.Writer, exitOnError bool) (*octokit.Team, error)
- func GetTeamMembers(org, team string, logger pine.Writer) ([]octokit.User, *octokit.Team, error)
- func HandleClientError(resp *octokit.Result, logger pine.Writer)
- func NewClient() *octokit.Client
- func NormalizeRepoName(in string) (string, bool)
- func UserIsOrg(name string) bool
- type Alphabetic
- type RepoURL
Constants ¶
This section is empty.
Variables ¶
var Logger = pine.NewWriter("gh")
Logger is the main gh logger instance
Functions ¶
func AutoCompleteRepoName ¶
AutoCompleteRepoName attempts to autocomplete an incomplete repository name using the GITHUB_USERNAME environment variable
func CurrentUserName ¶
CurrentUserName attempts to get a GitHub username defined in environment variables
func FormatError ¶
func FormatError(err *octokit.ResponseError) string
FormatError attempts to format a given octokit ResponseError
func GetAllCollabs ¶
GetAllCollabs returns a list of all collaborators of a given repository
func GetAllTeamsForOrg ¶
GetAllTeamsForOrg returns a list of all teams for a given organization
func GetAllTeamsForRepo ¶
GetAllTeamsForRepo returns a list of teams that have access to a given repository
func GetAllUserRepositories ¶
func GetAllUserRepositories() ([]octokit.Repository, error)
GetAllUserRepositories iterates all API pages and returns a list of repositories that belongs to the authenticated user
func GetAllUsersForOrg ¶
GetAllUsersForOrg returns a list of users that belongs to an organization
func GetTeamByName ¶
GetTeamByName returns a Team instance belonging to a given organization under a given name
func GetTeamMembers ¶
GetTeamMembers returns a list of members of a given organization team
func HandleClientError ¶
HandleClientError checks the state of an octokit Result, prints and exits the application if an error ocurred during the request
func NewClient ¶
NewClient creates a new Octokit client instance based on the access token obtained from the environment variables
func NormalizeRepoName ¶
NormalizeRepoName tries to normalize a repository name by replacing special characters and stripping a .git suffix from it.
Types ¶
type Alphabetic ¶
type Alphabetic []string
Alphabetic is reponsible for sorting strings alphabetically ignoring case
func (Alphabetic) Len ¶
func (list Alphabetic) Len() int
func (Alphabetic) Less ¶
func (list Alphabetic) Less(i, j int) bool
func (Alphabetic) Swap ¶
func (list Alphabetic) Swap(i, j int)
type RepoURL ¶
RepoURL represents a username/reponame structure
func RepoURLFromString ¶
RepoURLFromString creates a new RepoURL struct from a given string
func (*RepoURL) AutoComplete ¶
func (r *RepoURL) AutoComplete()
AutoComplete attempts to autocomplete a RepoURL instance using the GITHUB_USERNAME environment variable