-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #333 from hearchco/as/fix/tiny
fix: switch to consts instead of runtime structs and comments
- Loading branch information
Showing
82 changed files
with
581 additions
and
654 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package bing | ||
|
||
import ( | ||
"github.com/hearchco/agent/src/search/engines" | ||
) | ||
|
||
const ( | ||
seName = engines.BING | ||
searchURL = "https://www.bing.com/search" | ||
) | ||
|
||
var origins = [...]engines.Name{seName} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package bingimages | ||
|
||
import ( | ||
"github.com/hearchco/agent/src/search/engines" | ||
) | ||
|
||
const ( | ||
seName = engines.BINGIMAGES | ||
searchURL = "https://www.bing.com/images/async" | ||
) | ||
|
||
var origins = [...]engines.Name{seName} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package brave | ||
|
||
import ( | ||
"github.com/hearchco/agent/src/search/engines" | ||
) | ||
|
||
const ( | ||
seName = engines.BRAVE | ||
searchURL = "https://search.brave.com/search" | ||
) | ||
|
||
var origins = [...]engines.Name{seName, engines.GOOGLE} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package brave | ||
|
||
import ( | ||
"fmt" | ||
"strings" | ||
|
||
"github.com/hearchco/agent/src/search/engines/options" | ||
) | ||
|
||
const ( | ||
paramKeyPage = "offset" | ||
paramKeyLocale = "country" // Should be last 2 characters of Locale. | ||
paramKeySafeSearch = "safesearch" // Can be "off" or "strict". | ||
|
||
paramSource = "source=web" | ||
paramSpellcheck = "spellcheck=0" | ||
) | ||
|
||
func localeCookieString(locale options.Locale) string { | ||
region := strings.SplitN(strings.ToLower(locale.String()), "_", 2)[1] | ||
return fmt.Sprintf("%v=%v", paramKeyLocale, region) | ||
} | ||
|
||
func safeSearchCookieString(safesearch bool) string { | ||
if safesearch { | ||
return fmt.Sprintf("%v=%v", paramKeySafeSearch, "strict") | ||
} else { | ||
return fmt.Sprintf("%v=%v", paramKeySafeSearch, "off") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.