-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(webscraper): add implementation from masa-oracle #12
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3a135ec
chore(ci): split dependency target for faster test runs
mudler 3200cfd
chore: expect []byte as results of jobs
mudler c5e4c40
feat(webscraper): implement webscraping with Colly (from masa-oracle)
mudler e315437
fix(retries): add sleep between retries and improve error messages
mudler 205458e
return a job result with the Client API
mudler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -1,33 +1,54 @@ | ||
module github.com/masa-finance/tee-worker | ||
|
||
go 1.22.2 | ||
|
||
go 1.21 | ||
|
||
toolchain go1.21.11 | ||
require ( | ||
github.com/cenkalti/backoff v2.2.1+incompatible | ||
github.com/edgelesssys/ego v1.5.4 | ||
github.com/gocolly/colly v1.2.0 | ||
github.com/google/uuid v1.6.0 | ||
github.com/joho/godotenv v1.5.1 | ||
github.com/labstack/echo/v4 v4.12.0 | ||
github.com/onsi/ginkgo/v2 v2.20.2 | ||
github.com/onsi/gomega v1.34.2 | ||
github.com/onsi/ginkgo/v2 v2.15.0 | ||
github.com/onsi/gomega v1.32.0 | ||
github.com/sirupsen/logrus v1.9.3 | ||
) | ||
|
||
require ( | ||
github.com/PuerkitoBio/goquery v1.9.0 // indirect | ||
github.com/andybalholm/cascadia v1.3.2 // indirect | ||
github.com/antchfx/htmlquery v1.3.3 // indirect | ||
github.com/antchfx/xmlquery v1.4.2 // indirect | ||
github.com/antchfx/xpath v1.3.2 // indirect | ||
github.com/chzyer/readline v1.5.1 // indirect | ||
github.com/go-jose/go-jose/v4 v4.0.4 // indirect | ||
github.com/go-logr/logr v1.4.2 // indirect | ||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect | ||
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect | ||
github.com/gobwas/glob v0.2.3 // indirect | ||
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect | ||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect | ||
github.com/golang/protobuf v1.5.3 // indirect | ||
github.com/google/go-cmp v0.6.0 // indirect | ||
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect | ||
github.com/joho/godotenv v1.5.1 // indirect | ||
github.com/google/pprof v0.0.0-20240525172833-67f7ab83a680 // indirect | ||
github.com/ianlancetaylor/demangle v0.0.0-20240312041847-bd984b5ce465 // indirect | ||
github.com/kennygrant/sanitize v1.2.4 // indirect | ||
github.com/labstack/gommon v0.4.2 // indirect | ||
github.com/mattn/go-colorable v0.1.13 // indirect | ||
github.com/mattn/go-isatty v0.0.20 // indirect | ||
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect | ||
github.com/temoto/robotstxt v1.1.2 // indirect | ||
github.com/valyala/bytebufferpool v1.0.0 // indirect | ||
github.com/valyala/fasttemplate v1.2.2 // indirect | ||
golang.org/x/crypto v0.27.0 // indirect | ||
golang.org/x/net v0.28.0 // indirect | ||
golang.org/x/net v0.29.0 // indirect | ||
golang.org/x/sys v0.25.0 // indirect | ||
golang.org/x/text v0.18.0 // indirect | ||
golang.org/x/time v0.5.0 // indirect | ||
golang.org/x/tools v0.24.0 // indirect | ||
google.golang.org/appengine v1.6.8 // indirect | ||
google.golang.org/protobuf v1.34.1 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change? We're unmarshalling twice (once to a
[]byte
, and from there to the actual data)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the rationale behind this change it's that when using
interface{}
it forces the caller to guess the underlying type: while this is not an urgent issue it made look the code quite ugly to see, and eventually added more complexity. I found out the switch to increase readibility and avoided an extra step.when using interfaces the result was a marshal of an interface, that had two consequences:
"data"
including the"
, becauseinterface{}
was marshaled to a string type