Documentation ¶
Index ¶
Constants ¶
const ( GITHUB = "github" GITLAB = "gitlab" BITBUCKET = "bitbucket" )
const ( BASE_URL = "https://github.com" GITHUB_BASE_URL = "https://api.github.com" CLIENT_ID = "ca711ca70149e4948032" GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code" ACCESS_TOKEN = "/access_token" SCOPES = "repo" ACCEPT_JSON = "application/json" ACCEPT_VDN = "application/vnd.github+json" GITHUB_API_VERSION = "2022-11-28" )
Variables ¶
This section is empty.
Functions ¶
func ExtractUserRepoName ¶ added in v0.10.3
ExtractUserRepoName takes the output from <git remote --verbose> command as input and attempts to extract the user name and repository name from out
func ReadAccessToken ¶ added in v0.8.0
func WriteToken ¶
WriteToken accepts an access token and the source code management platform (GitHub, GitLab etc...) and will write the token to a configuration file. This will be used to authorize future requests for reporting issues.
Types ¶
type GitConfigManager ¶
GitConfigManager provides flexibility to have different implementations of Authorize and Report for each source code management platform supported
func NewGitManager ¶ added in v0.10.0
func NewGitManager(scm, userName, repoName string) (GitConfigManager, error)
@TODO add other source code management structs to NewGitManager once their implementations are created
type GitHubManager ¶
type GitHubManager struct {
// contains filtered or unexported fields
}
func (*GitHubManager) Authorize ¶
func (gh *GitHubManager) Authorize() error
Authorize satisfies the GitManager interface. Each source code management platform will have their own version of how to authorize so that the program can submit issues on the users behalf. This implementation uses GitHubs device oauth flow. See their docs for more detailed information. First, a user code is created and a browser opens to GitHubs verification url. While the program is waiting for the user to enter the code, we poll an endpoint and check if the user has authorized the app. Once they have done so, an access token is returned from the service and is then written to ~/.config/issue-summoner/config.json
func (*GitHubManager) Report ¶ added in v0.8.0
func (gh *GitHubManager) Report(issues []GitIssue) <-chan Reporter
type IssueSummonerConfig ¶
type IssueSummonerConfig = map[string]ScmTokenConfig
type ScmTokenConfig ¶
type ScmTokenConfig struct {
AccessToken string
}