Skip to content

Commit

Permalink
add 2 variables: description and community (#263)
Browse files Browse the repository at this point in the history
* add 2 variables: description and community

* Update sources_test.go
  • Loading branch information
ylyangtw committed Jul 1, 2024
1 parent d55b046 commit 91f7b59
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/config/gleanerConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var gleanerTemplate = map[string]interface{}{
"pid": "",
"propername": "",
"domain": "",
"description":"",
},
}

Expand Down
3 changes: 3 additions & 0 deletions internal/config/sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ type Sources struct {
ApiPageLimit int
IdentifierType string
FixContextOption ContextOption
Description string
}

// add needed for file
Expand All @@ -94,6 +95,7 @@ type SourcesConfig struct {
IdentifierPath string // JSON Path to the identifier
IdentifierType string
FixContextOption ContextOption
Description string
}

var SourcesTemplate = map[string]interface{}{
Expand All @@ -112,6 +114,7 @@ var SourcesTemplate = map[string]interface{}{
"identifierpath": "",
"identifiertype": JsonSha,
"fixcontextoption": "https",
"description": "",
},
}

Expand Down
4 changes: 4 additions & 0 deletions internal/config/sources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func TestGetActiveSourceByType(t *testing.T) {
ApiPageLimit: 0,
IdentifierType: IdentifierSha,
FixContextOption: 0,
Description: "",
},
}
results := GetActiveSourceByType(sources, "sitemap")
Expand Down Expand Up @@ -134,6 +135,7 @@ func TestGetActiveSourceByHeadless(t *testing.T) {
ApiPageLimit: 0,
IdentifierType: IdentifierSha,
FixContextOption: 0,
Description: "",
},
}
results := GetActiveSourceByHeadless(sources, true)
Expand All @@ -158,6 +160,7 @@ func TestGetActiveSourceByHeadless(t *testing.T) {
ApiPageLimit: 0,
IdentifierType: "",
FixContextOption: 0,
Description: "",
},
}
results = GetActiveSourceByHeadless(sources, false)
Expand Down Expand Up @@ -215,6 +218,7 @@ func TestGetSourceByName(t *testing.T) {
ApiPageLimit: 0,
IdentifierType: IdentifierSha,
FixContextOption: 0,
Description: "",
}

results, err := GetSourceByName(sources, "test1")
Expand Down

0 comments on commit 91f7b59

Please sign in to comment.