Documentation ¶
Index ¶
- Variables
- func CloneRepository(repository, ref string, shouldCreate bool) error
- func CreatePullRequest() error
- func ForkRepository(repository string) error
- func ForkSuccess(resp *http.Response) error
- func GetForkResource() *nap.RestResource
- func GetPullRequestResource() *nap.RestResource
- func GetReadmeResource() *nap.RestResource
- func GetRepositoryReadme(repository string) error
- func GetSearchResource() *nap.RestResource
- func GitHubAPI() *nap.API
- func PullRequestDefaultRouter(resp *http.Response) error
- func PullRequestSuccess(resp *http.Response) error
- func ReadmeDefaultRouter(resp *http.Response) error
- func ReadmeSuccess(resp *http.Response) error
- func SearchByKeyword(keywords []string) error
- func SearchDefaultRouter(resp *http.Response) error
- func SearchSuccess(resp *http.Response) error
- type ForkResponse
- type GHRepo
- type PullRequestPayload
- type PullRequestResponse
- type ReadResponse
- type SearchResponse
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
View Source
var CloneCmd = &cobra.Command{ Use: "clone", Short: "Clone repository from GH", Run: func(cmd *cobra.Command, args []string) { if len(args) <= 0 { log.Fatalln("You must supply the repository") } if err := CloneRepository(args[0], ref, create); err != nil { log.Fatalln("error when closing repository: ", err) } }, }
View Source
var DocsCmd = &cobra.Command{ Use: "docs", Short: "Read the documentation for a repository", Run: func(cmd *cobra.Command, args []string) { if len(args) <= 0 { log.Fatalln("Invalid repository args") } if err := GetRepositoryReadme(args[0]); err != nil { log.Fatalln("Failed to get docs", err) } }, }
View Source
var ForkCmd = &cobra.Command{ Use: "fork", Short: "fork a Github repository", Run: func(cmd *cobra.Command, args []string) { if len(args) <= 0 { log.Fatalln("you must supply a repository") } if err := ForkRepository(args[0]); err != nil { log.Fatalln("unable to fork repository: ", err) } }, }
View Source
var PullRequestCmd = &cobra.Command{ Use: "pullrequest", Short: "Create a Pull Request", Run: func(cmd *cobra.Command, args []string) { if err := CreatePullRequest(); err != nil { log.Fatalln("Failed to create a pull request", err) } }, }
View Source
var SearchCmd = &cobra.Command{ Use: "search", Short: "Search for GH repos by keyword", Run: func(cmd *cobra.Command, args []string) { if err := SearchByKeyword(args); err != nil { log.Fatalln("Search failed: ", err) } }, }
Functions ¶
func CloneRepository ¶
func CreatePullRequest ¶
func CreatePullRequest() error
func GetPullRequestResource ¶
func GetPullRequestResource() *nap.RestResource
func GetReadmeResource ¶
func GetReadmeResource() *nap.RestResource
func GetRepositoryReadme ¶
func PullRequestSuccess ¶
func ReadmeDefaultRouter ¶
func ReadmeSuccess ¶
func SearchByKeyword ¶
func SearchDefaultRouter ¶
check for code status
Types ¶
type ForkResponse ¶
type GHRepo ¶
type GHRepo struct { RepoDir string // contains filtered or unexported fields }
func (*GHRepo) RepositoryURL ¶
this function will return the GH repository endpoint
type PullRequestPayload ¶
type PullRequestResponse ¶
type PullRequestResponse struct {
URL string `json:"html_url"`
}
type ReadResponse ¶
type ReadResponse struct {
Content string `json:"content"`
}
type SearchResponse ¶
type SearchResponse struct {
Results []*SearchResult `json:"items"` // return another slice
}
type SearchResult ¶
type SearchResult struct {
FullName string `json:"full_name"`
}
Click to show internal directories.
Click to hide internal directories.