home2git

package
v0.0.1-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PROMPT = map[string]string{
	"home2git_link":   "Given the list of repository links [%s] and the homepage URL '%s', select the most likely repository link that matches the homepage. If a direct match is found, return the URL in the format 'URL is: [matched_url]'. If no direct match is found, check other repositories on GitHub, GitLab, or Gitee. If a related repository exists, respond with 'URL is: [url]'. If no relevant repository can be identified, respond with 'does not exist'.",
	"home2git_nolink": "Check if there is a git repository for %s hosted on platforms like GitHub, GitLab, or Gitee. If it exists, respond in the format 'URL is: [url]'. If no repository exists, respond with 'does not exist'.",
}

Functions

func Check

func Check(githubURL string) string

func DownloadHTML

func DownloadHTML(url string) (string, error)
func FetchAllLinks() ([][]string, error)

func FindGitRepository

func FindGitRepository(homepageURL string, links []string, packageName string, attempts int, url string) string

func FindLinksInHTML

func FindLinksInHTML(url string, htmlContent string, depth int) ([]string, error)

func Home2git

func Home2git(flagConfigPath string, outputCSV string, url string)

func InvokeModel

func InvokeModel(prompt string, attempts int, url string) string

func ProcessHomepage

func ProcessHomepage(packageName string, links []string, homepageURL string, url string) string

Types

type GitLink struct {
	URL     string
	Pattern *regexp.Regexp
}
func CheckIfGitLink(url string) *GitLink

type Response

type Response struct {
	Response string `json:"response"`
	Done     bool   `json:"done"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL