Commit Graph

13 Commits

Author SHA1 Message Date
Paul Lindner b09cd377d7 Switch to stdlib context from golang.org/x/net/context
This switches most usages of the pre-1.7 context library to use the
standard library.  Remaining usages are in:

  app/publisher/main.go
  pkg/fs/...

Change-Id: Ia74acc39499dcb39892342a2c9a2776537cf49f1
2017-11-26 01:12:26 -08:00
Attila Tajti 6476233ad1 pkg/search: add cached geocode results used in benchmarks
Cache geocode results used in BenchmarkLocationPredicate
so we don't hit the (random?) google geocode API errors.

Change-Id: Ic5be5afc36fd8330d0ae0be4677f0faca87d1b21
2016-11-09 08:01:15 +01:00
Will Norris 77ed42edf8 add canonical import paths
The import path was added to the go file that included the package
documentation if one existed.  Otherwise, I used what seemed to be the
primary file for the package.

Fixes #689

Change-Id: If51be0e86529fd6f179e80af6781e639f8550fd2
2016-03-13 19:57:14 -07:00
mpl 718c9d8b63 pkg/importer: use go4.org/ctxutil
side-effect: fix an unchecked type assertion, and use a conventional
key for the HTTP client associated with the context (instead of our own
string).

Change-Id: I2701de3f41f1f1c56fe3b76bbf590c0e5b39bc72
2015-12-16 15:30:09 +01:00
Tamás Gulácsi 9f7e1df32b Remove pkg/context
Use golang.org/x/net/context instead.

Fixes #648.

Change-Id: I676a2f25458be97610a49d6f954f2102cbd373fa
2015-12-12 23:09:02 +01:00
mpl 8d76f0563b vendor: go4.org/syncutil/singleflight
Previously pkg/singleflight

Imported from github.com/camlistore/go4/ at rev
039bcc4ca7e407e5611cbdf15a1f208be0bceda0

Also reimport vendor/go4.org/syncutil because some of it got split into
github.com/camlistore/go4/syncutil/syncdebug

Change-Id: Iaf48de71928d17e0410442ea6f5bef7262ba60d2
2015-11-24 17:28:28 +01:00
Brad Fitzpatrick 9868aa0f8d Remove httputil.CloseBody relic. 2015-11-23 19:02:10 -08:00
Steven L. Speek db1a4cf6aa search: Self-documenting atoms
Parse errors in the atoms have a position too
Easier to add new search predicates

Change-Id: I9d2e890b9afcfb524aafa8f1e4e1debc683555ac
2014-05-15 00:42:32 +02:00
Brad Fitzpatrick eb27581da7 httputil: add DecodeJSON and CloseBody helpers, then use them everywhere
httputil.CloseBody closes a http.Response.Body nicely, such that it's
more likely to be re-used.

httputil.DecodeJSON parses JSON from a Response.Body and closes the
body. It also keeps a temporary copy of the input, for error messages.

Then use them everywhere, to improve HTTP TCP connection re-use.

And misc other clean-ups.

Change-Id: I5dc44be0165b13659459ed29ce5ab44c17d9739f
2014-01-28 22:00:52 -08:00
Brad Fitzpatrick 466f166817 geocode: if Google returns a whole-world geometry, use its viewport instead
Change-Id: Iec4abf2ad117ab37a3f23fedc12e6e7b3943fc4e
2014-01-25 09:26:18 -08:00
Brad Fitzpatrick f8d9e6663d geocode: move logging
Change-Id: I42d901510f9d8085c29792fd6b7ea8e1dc082c06
2013-12-24 13:43:25 -08:00
Brad Fitzpatrick f053007954 geocode: cache and dup-suppress lookups
Change-Id: I600b9d9957ea74d4b91d0b162c7de55d643e0ee9
2013-12-24 12:43:19 -08:00
Brad Fitzpatrick d759e12b86 Add new geocode package.
Change-Id: Iae3c4b2cd09d7fd21e41fbc6f4fa5222d1dfcfee
2013-12-23 19:09:50 -08:00