Documentation
¶
Index ¶
- Constants
- Variables
- func CloneRepository(repoPath, url string) error
- func OpenRepository(url string) error
- func OpenUrl(url string) error
- func RepositoryPath(url string) string
- func Run(ctx context.Context) error
- func SearchCode(ctx context.Context, input SearchInput) (searchResult, error)
- func SearchRepositories(ctx context.Context, input SearchInput) (searchResult, error)
- func SendToChan(data any, err error)
- func SetAPIs(apis []API)
- type API
- type CodeSearchResult
- type CodeSearchResultItem
- type ContentResult
- type Event
- type FooterMessage
- type GithubClient
- func (g *GithubClient) FetchAllRepostories(ctx context.Context, org string) ([]Repository, error)
- func (g *GithubClient) FetchEventsFromIssue(ctx context.Context, issue Issue) ([]Event, error)
- func (g *GithubClient) FetchReadMe(ctx context.Context, fullName string) (string, error)
- func (g *GithubClient) FetchSearchResultContents(ctx context.Context, item CodeSearchResultItem) (string, error)
- func (g GithubClient) Request(ctx context.Context, method string, url string, paramMap map[string]any) ([]byte, error)
- func (g GithubClient) RequestWithEndpoint(ctx context.Context, method string, endpoint string, paramMap map[string]any) ([]byte, error)
- func (g *GithubClient) Search(ctx context.Context, query string, page int, per_page int) (CodeSearchResult, error)
- func (g *GithubClient) SearchIssues(ctx context.Context, query string, page int, per_page int) (IssueSearchResult, error)
- func (g *GithubClient) SearchRepositories(ctx context.Context, query string, page int, per_page int) (RepositoryItemsSearchResult, error)
- type Issue
- type IssueSearchResult
- type ReadMeResult
- type Repository
- type RepositoryItemsSearchResult
- type ResultItemWithOrigin
- type SearchInput
- type SearchView
- type User
Constants ¶
View Source
const REPOSITORY_NUMBER_PER_PAGE = 100
Variables ¶
View Source
var Clients = []GithubClient{}
View Source
var Finalizers = make(chan func(), 16)
Functions ¶
func CloneRepository ¶
func OpenRepository ¶
func RepositoryPath ¶
func SearchCode ¶
func SearchCode(ctx context.Context, input SearchInput) (searchResult, error)
func SearchRepositories ¶
func SearchRepositories(ctx context.Context, input SearchInput) (searchResult, error)
func SendToChan ¶ added in v0.0.2
Types ¶
type CodeSearchResult ¶
type CodeSearchResult struct { TotalCount int `json:"total_count"` Items []CodeSearchResultItem `json:"items"` }
type CodeSearchResultItem ¶ added in v0.0.6
type CodeSearchResultItem struct { Url string `json:"url"` Path string `json:"path"` HtmlUrl string `json:"html_url"` Repository Repository `json:"repository"` }
func (CodeSearchResultItem) Origin ¶ added in v0.0.6
func (i CodeSearchResultItem) Origin() string
type ContentResult ¶
func FetchContent ¶
func FetchContent(ctx context.Context, origin string, item CodeSearchResultItem) (ContentResult, error)
type FooterMessage ¶
type FooterMessage struct {
}type GithubClient ¶
type GithubClient struct { Origin string // contains filtered or unexported fields }
func NewClient ¶
func NewClient(origin, apiAddress string) (GithubClient, error)
func (*GithubClient) FetchAllRepostories ¶
func (g *GithubClient) FetchAllRepostories(ctx context.Context, org string) ([]Repository, error)
func (*GithubClient) FetchEventsFromIssue ¶
func (*GithubClient) FetchReadMe ¶
func (*GithubClient) FetchSearchResultContents ¶
func (g *GithubClient) FetchSearchResultContents(ctx context.Context, item CodeSearchResultItem) (string, error)
func (GithubClient) RequestWithEndpoint ¶
func (*GithubClient) Search ¶
func (g *GithubClient) Search(ctx context.Context, query string, page int, per_page int) (CodeSearchResult, error)
func (*GithubClient) SearchIssues ¶
func (g *GithubClient) SearchIssues(ctx context.Context, query string, page int, per_page int) (IssueSearchResult, error)
func (*GithubClient) SearchRepositories ¶
func (g *GithubClient) SearchRepositories(ctx context.Context, query string, page int, per_page int) (RepositoryItemsSearchResult, error)
type IssueSearchResult ¶
type ReadMeResult ¶
func FetchReadMe ¶
func FetchReadMe(ctx context.Context, origin string, repo Repository) (ReadMeResult, error)
type Repository ¶
type RepositoryItemsSearchResult ¶
type RepositoryItemsSearchResult struct { TotalCount int `json:"total_count"` Items []Repository `json:"items"` }
type ResultItemWithOrigin ¶ added in v0.0.6
type SearchView ¶ added in v0.0.6
type SearchView struct { Type string Result searchResult IsSearching bool ContentMap map[string]string ContentRequestMap map[string]bool // contains filtered or unexported fields }
func NewCodeSearchView ¶ added in v0.0.2
func NewCodeSearchView() *SearchView
func NewRepoSearchView ¶ added in v0.0.2
func NewRepoSearchView() *SearchView
func (*SearchView) Body ¶ added in v0.0.6
func (m *SearchView) Body() *tui.View
func (*SearchView) HandleEvent ¶ added in v0.0.6
func (m *SearchView) HandleEvent(event any) any
func (*SearchView) SubView ¶ added in v0.0.6
func (m *SearchView) SubView() *tui.View
Click to show internal directories.
Click to hide internal directories.