mirror of
https://github.com/Dvorinka/Devour.git
synced 2026-06-04 04:23:02 +00:00
update
This commit is contained in:
@@ -17,6 +17,7 @@ const (
|
||||
SourceTypeGitHub SourceType = "github"
|
||||
SourceTypeOpenAPI SourceType = "openapi"
|
||||
SourceTypeLocal SourceType = "local"
|
||||
SourceTypeLocalSearch SourceType = "localsearch"
|
||||
SourceTypeGoDocs SourceType = "godocs"
|
||||
SourceTypeRustDocs SourceType = "rustdocs"
|
||||
SourceTypePythonDocs SourceType = "pythondocs"
|
||||
@@ -34,15 +35,18 @@ const (
|
||||
|
||||
// Source represents a documentation source to scrape.
|
||||
type Source struct {
|
||||
Name string `yaml:"name"`
|
||||
Type SourceType `yaml:"type"`
|
||||
URL string `yaml:"url,omitempty"`
|
||||
Repo string `yaml:"repo,omitempty"`
|
||||
Branch string `yaml:"branch,omitempty"`
|
||||
Path string `yaml:"path,omitempty"`
|
||||
Include []string `yaml:"include,omitempty"`
|
||||
Exclude []string `yaml:"exclude,omitempty"`
|
||||
Schedule string `yaml:"schedule,omitempty"`
|
||||
Name string `yaml:"name"`
|
||||
Type SourceType `yaml:"type"`
|
||||
URL string `yaml:"url,omitempty"`
|
||||
Query string `yaml:"query,omitempty"`
|
||||
ResultLimit int `yaml:"result_limit,omitempty"`
|
||||
Domains []string `yaml:"domains,omitempty"`
|
||||
Repo string `yaml:"repo,omitempty"`
|
||||
Branch string `yaml:"branch,omitempty"`
|
||||
Path string `yaml:"path,omitempty"`
|
||||
Include []string `yaml:"include,omitempty"`
|
||||
Exclude []string `yaml:"exclude,omitempty"`
|
||||
Schedule string `yaml:"schedule,omitempty"`
|
||||
}
|
||||
|
||||
// Document represents a scraped document.
|
||||
@@ -113,6 +117,11 @@ func DetectSourceType(input string) SourceType {
|
||||
}
|
||||
}
|
||||
|
||||
// MCP servers are hosted under Docker Hub paths.
|
||||
if strings.Contains(input, "hub.docker.com/mcp/") {
|
||||
return SourceTypeMCPDocs
|
||||
}
|
||||
|
||||
// Check for OpenAPI specs
|
||||
if strings.HasSuffix(input, ".json") || strings.HasSuffix(input, ".yaml") || strings.HasSuffix(input, ".yml") {
|
||||
if strings.Contains(strings.ToLower(input), "openapi") || strings.Contains(strings.ToLower(input), "swagger") {
|
||||
|
||||
Reference in New Issue
Block a user