From 91f7b592f28550929adf239f9b7f11088dacf085 Mon Sep 17 00:00:00 2001 From: Ya-Lan Yang <63822845+ylyangtw@users.noreply.github.com> Date: Mon, 1 Jul 2024 09:54:11 -0500 Subject: [PATCH] add 2 variables: description and community (#263) * add 2 variables: description and community * Update sources_test.go --- internal/config/gleanerConfig.go | 1 + internal/config/sources.go | 3 +++ internal/config/sources_test.go | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/internal/config/gleanerConfig.go b/internal/config/gleanerConfig.go index 02792dba..bbaec4c9 100644 --- a/internal/config/gleanerConfig.go +++ b/internal/config/gleanerConfig.go @@ -27,6 +27,7 @@ var gleanerTemplate = map[string]interface{}{ "pid": "", "propername": "", "domain": "", + "description":"", }, } diff --git a/internal/config/sources.go b/internal/config/sources.go index 6f7891d3..dc94df62 100644 --- a/internal/config/sources.go +++ b/internal/config/sources.go @@ -76,6 +76,7 @@ type Sources struct { ApiPageLimit int IdentifierType string FixContextOption ContextOption + Description string } // add needed for file @@ -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{}{ @@ -112,6 +114,7 @@ var SourcesTemplate = map[string]interface{}{ "identifierpath": "", "identifiertype": JsonSha, "fixcontextoption": "https", + "description": "", }, } diff --git a/internal/config/sources_test.go b/internal/config/sources_test.go index c37b0787..60c7e741 100644 --- a/internal/config/sources_test.go +++ b/internal/config/sources_test.go @@ -96,6 +96,7 @@ func TestGetActiveSourceByType(t *testing.T) { ApiPageLimit: 0, IdentifierType: IdentifierSha, FixContextOption: 0, + Description: "", }, } results := GetActiveSourceByType(sources, "sitemap") @@ -134,6 +135,7 @@ func TestGetActiveSourceByHeadless(t *testing.T) { ApiPageLimit: 0, IdentifierType: IdentifierSha, FixContextOption: 0, + Description: "", }, } results := GetActiveSourceByHeadless(sources, true) @@ -158,6 +160,7 @@ func TestGetActiveSourceByHeadless(t *testing.T) { ApiPageLimit: 0, IdentifierType: "", FixContextOption: 0, + Description: "", }, } results = GetActiveSourceByHeadless(sources, false) @@ -215,6 +218,7 @@ func TestGetSourceByName(t *testing.T) { ApiPageLimit: 0, IdentifierType: IdentifierSha, FixContextOption: 0, + Description: "", } results, err := GetSourceByName(sources, "test1")