Documentation ¶
Overview ¶
GraphQL specifics
Unfortunately the strongly-typed gql libs for Go aren't perfect for dynamic-length queries. If the entire query structure isn't known at compile time, there's not a great way to model it.
So we use text/template with a bit of care. The alternative is to make a bunch of queries in parallel. Let's err on the side of not increasing surface area for issues - especially since GitHub likes to ratelimit.
This is the high-level flow:
- Run search with given terms - Coerce results into our own minimal structure - Look up default branch names for every returned repo
- This costs ~300-500ms so you can skip this step with 'set-default-branch'
- Fetch file contents for every returned Path - Overlay colorized text matches onto the contents - Write each line to stdout