cs

command module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL