Commit Graph

73 Commits

Author SHA1 Message Date
mpl 26cb64e825 Introduce search.QueryDescriber interface. *client.Client implements it.
There are several places where we're using a *search.Handler, when we
only want to be able to do query and describe requests. When these
places need to be moved also out of the context of camlistored, (like
when making a server app such as the publisher), the QueryDescriber can
be used, and the adequate implementation (*search.Handler,
*client.Client, or any other) is used depending on the context.

Change-Id: Ie1c5bb6f1bbba32c24a8eb2d1175af95ffcc8335
2014-07-21 22:20:24 +02:00
Robert Kroeger f40e2e6e61 Clarified use of camtool googinit
To avoid user confusion, force camtool googinit use to actually
specify if Google Cloud Storage or Google Drive auth setup is
desired.

Change-Id: I6541b4a589de2dda73b725fcaf7bcdadd3f60b65
2014-07-07 08:33:53 -06:00
tnt 5d8eeb534b Fixed wrong calls to formatting functions.
E.g: fmt.Println("%s", "hello world") -> fmt.Printf("%s", "hello world")

Change-Id: I51c0bd54c14173e074fafd86c83a5287fcdb1520
2014-06-30 22:05:22 +02: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
mpl a001c61339 camtool sync, localdisk: cancel enumerate to avoid channel lock
http://camlistore.org/issue/433

Change-Id: Id20d759dc5192dd34e69a866d8dcd44ca106d63b
2014-05-09 01:36:38 +02:00
mpl 45ce6cfdd3 mysql: replace mymysql with go-sql-driver
from github.com/go-sql-driver/mysql at 9a7aa3606b82e2081a13a008ada88dfdb96c20fd

Context: http://camlistore.org/issue/428

Change-Id: Ia93ac35da02933bd03d2c6b7b8e5e549ba0472cb
2014-05-01 17:42:51 +02:00
jakubbrzeski e38dfda67a camtool: added googinit command
It initializes drive or googlestorage.
Deleted gsinit command.

Change-Id: I4d3b82018df9eec4d726cf91fd11be527c9a778a
2014-04-24 13:12:47 +02:00
Hernan Grecco a6e4f87bc7 Implemented an optional parameter (attr) in 'camtool claims' to filter by claim type
For example, to obtain all the versions for a given file use:

   $ camtool claims <permanode> --attr="camliContent"

Change-Id: Ibb267a0f95702faa0e7e763c99f99ee446559aac
2014-03-19 00:45:51 -03:00
Brad Fitzpatrick bf94a73859 Get rid of SeekFetcher vs StreamingFetcher distinction and complexity.
StreamingFetcher is now just Fetcher, and its FetchStreaming is now
just Fetch.

SeekFetcher is gone. Blobs are max 16 MB anyway, so we can slurp to
memory when needed. The main thing that cared about SeekFetcher
was the GET handler, ServeBlobref, because http.ServeContent needed
one for range requests. That's rewritten in an earlier commit, using
the FakeSeeker from another earlier commit.

Lot of code got simpler as a result.

Change-Id: Ib819413e48a8f9b8d97f596d0fbf771dab211f11
2014-03-14 12:29:13 -07:00
mpl dab702ea49 camtool sync: ignore diff identity with localdisk
When either the source or the destination is a localdisk, there is no
need to warn about differing identities.

Change-Id: Ia61779dd7907099c5ab58d9ca876cf4690f6fe05
2014-03-13 16:10:34 +01:00
Brad Fitzpatrick bf892c7637 camtool: add search subcommand
Change-Id: I8738c2eb7eae4417778be39a4237e02d42965615
2014-03-10 19:47:30 -07:00
Brad Fitzpatrick 34d4513eb4 Merge "camtool list/sync: fix 3 bugs" 2014-03-09 05:22:31 +00:00
mpl 73526917a1 camtool list/sync: fix 3 bugs
1) revert to printing to stdout (broke in
08923e1c00) for actual output

2) do not warn about different identities when "syncing" to stdout

3) check blob was actually described before using its fields

Change-Id: Ibb3aa4c560e1b0036aba080807400e8820163cc9
2014-03-08 19:15:46 +01:00
Brad Fitzpatrick 76ba33b27a Move ListMissingDestinationBlobs from pkg/client to blobserver
Change-Id: I7489531fe2a1a5127b2212d5a5f80d4c4c614353
2014-03-06 15:04:15 -08:00
mpl 08923e1c00 camtool sync: warn when src and dest have different identities
http://camlistore.org/issue/281

Change-Id: I2e2d595534b14476293a031b88e312de3e0b3f4a
2014-03-01 23:47:49 +01:00
Brad Fitzpatrick bbfcc27d85 sync: use blob.Ref.Less instead of stringify to compare, fix API wart, more tests
Change-Id: Iffd98463becbcf6d62dd666b38fb00572b34725b
2014-03-01 11:34:57 -08:00
Brad Fitzpatrick 26cbd36e0b camput, camtool: update docs
Change-Id: If54df42be3b95ec9f10782454bc247449e1a74e6
2014-02-27 21:23:01 -08:00
mpl c4c4d6407a client: default to None auth if no auth in config
Defer warning until discovery fails.
Also fix SetupAuth error checks in camtool.

Change-Id: Ib554595603994e929d465e4e0de6acaf319d5b42
2014-02-27 01:37:59 +01:00
Brad Fitzpatrick a199802898 camtool: document reindex-diskpacked better
Change-Id: Ib2f669ddf4fa493572a811b0564f104fbaeea05a
2014-02-11 19:24:08 -08:00
Brad Fitzpatrick 9a3a3795bb camtool: remove TODO
Change-Id: I3d9ac173335bd68b66bd8dfb5e0e40894aef3f79
2014-02-09 15:49:24 -08:00
Brad Fitzpatrick ca58231336 camtool: remove duplicated code
Change-Id: I2009b132a1c10e60132333b9942aa4b5943b3932
2014-02-09 15:48:07 -08:00
Brad Fitzpatrick 16b4d5c7e3 camtool: add discovery subcommand
Change-Id: Ic4cbc2777719301d3e4f3cdb0b14c10be6f64b3e
2014-02-09 15:16:47 -08:00
Tamás Gulácsi 97520583b8 Use 'uint32' instead of 'int64' for blob sizes everywhere.
Not just in blob.SizedRef, but in blobserver.Fetch and
blobserver.FetchStreaming, too.
Blobs have a max size of 10-32 MB anyway, and the index.Corpus is now using
uint32 to save memory.

Change-Id: I1172445c2f9463fdaee55bfe0f1218d44be4aa53
2014-02-08 17:58:12 +01:00
mpl 9add1d2c87 Merge "camtool list: introduce -describe to print camliType for each blob" 2014-01-31 23:10:54 +00:00
mpl 8084d6a4c7 camtool list: introduce -describe to print camliType for each blob
Change-Id: I73630dc135a169f5b24a403b5662e7ad617cb40d
2014-01-31 19:12:29 +01:00
Brad Fitzpatrick bda047eef7 camtool: add env camsrcroot
Change-Id: I701e81ab732d7574a227e8f01ca09ac91c608481
2014-01-31 12:21:04 +01: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
mpl 448f266d72 rename pkg/serverconfig to pkg/serverinit
To avoid awkwardness with future pkg/types/serverconfig

http://camlistore.org/issue/339

Change-Id: If8a00941cdc269d6bcfe0f76c596154d5969bf0d
2014-01-23 17:18:46 +01:00
Brad Fitzpatrick 94ff6ac141 pkg/search, pkg/client, cmd/camtool: add 'camtool claims' subcommand
Change-Id: Id9d8381facd97a946c3582b226d433ab59b18da7
2014-01-14 11:48:49 -08:00
Brad Fitzpatrick d3b0e933b9 camtool: add describe command
Change-Id: I956c4a76f00bc96f2e5f2b1e5b19a1b656dd1585
2014-01-11 16:46:03 -08:00
Brad Fitzpatrick 67a2425ea7 Add camtool list subcommand.
Alias for sync --dest=stdout

Change-Id: Ic3714e3728852c09073f3adafe539ce494d5e219
2014-01-11 15:28:40 -08:00
mpl 1db2e7eaf3 pkg/client: auth and (camtool) TLS fixes
1) disallow auth from env when not in dev mode or on android
2) allow insecureTLS with flag in debug mode
3) set transport so that insecureTLS or trustedCert modes work

http://camlistore.org/issue/325

Change-Id: I6d8056bb75ffff5f002dfe9bd631ae996dc4e5ef
2014-01-09 11:23:40 -08:00
mpl 2588ff8c83 camtool: apparently forgot to add index.go in 2d85e017ff
Change-Id: I6b7ce9e70b15d622935950ac8b1f06d843590659
2013-12-29 00:03:58 +01:00
Brad Fitzpatrick 9fd329df80 Merge "cmd/camtool: (re)index command" 2013-12-26 17:29:03 +00:00
mpl 2d85e017ff cmd/camtool: (re)index command
http://camlistore.org/issue/193

Change-Id: I498f92bdc153f44dc84d4b47f03c47a8e7b54ad9
2013-12-26 18:23:15 +01:00
Dustin Sallings 3f967a1111 camput: set handlerConfig=true when generating a config
Change-Id: I10ca5274a90640dd72f7c678f1000cf0ddf5adf9
2013-12-25 01:53:02 -08:00
Brad Fitzpatrick 649390b9ef camtool: make diskpacked-reindex command a bit more user-friendly
Change-Id: Ic7cde2f453f5cd2716d929800b297cb766826acd
2013-12-24 20:16:36 -08:00
mpl 8fec95752c pkg/index: move postgresql to sorted + some fixes
Change-Id: Ia6410256ffe8d4cbc2b9a5c056d075707105ab08
2013-12-24 00:37:14 +01:00
mpl 62f8a252ff pkg/index: move mysql to sorted
also minor cleanups in sqlite and mongo

Change-Id: I1f371358997d929c72a8f63d2630a1c3fa4a0240
2013-12-18 20:18:20 +01:00
Brad Fitzpatrick 2af4040223 camtool: add env sub-command 2013-12-17 11:27:24 -08:00
mpl b62c94fdd1 pkg/index: move sqlite implementation to sorted
Change-Id: I1e300ffa14547fabeac8d255fd694054ebcb9e53
2013-12-16 17:35:27 +01:00
mpl 8c562e9135 camtool: dbinit mongo support
Change-Id: I289759ed9bdb34a6e108af1364c4a6bcfbb5982f
2013-12-13 17:25:03 +01:00
Brad Fitzpatrick b82b8efe4c Start of new context package and *context.Context type.
Will eventually be plumbed through lots of APIs, especially those requiring or benefiting from
cancelation notification and/or those needing access to the HTTP context (e.g. App Engine).

Change-Id: I591496725d620126e09d49eb07cade7707c7fc64
2013-12-02 13:20:51 -08:00
Brad Fitzpatrick 3fd356f457 gofmt
Change-Id: I900a49b3f76aec7ef65419f2a5ecaf3eae95defb
2013-11-28 11:58:47 -08:00
Tamás Gulácsi cb6f423eeb Add diskpacked-reindex subcommand to camtool
For checking and/or rebuilding index.kv of diskpacked packs.

Change-Id: I1ad87974b2daf58b1e767bb1df6f7b64e8b6359a
2013-11-28 20:44:27 +01:00
Steve Phillips 5dc853110f Added missing var 'which' used in a fmt.Errorf
Change-Id: I0b9a7c6a0c7e523a75f3e5beebbd860e0092a81f
2013-10-04 18:44:40 -07:00
Brad Fitzpatrick 79065de4b9 For SQLite compile errors, link to the wiki.
Change-Id: I34b1485daba6173d6665cfc56b6bba43164534d8
2013-09-19 10:17:57 +01:00
Brad Fitzpatrick 8319411ab4 Convert more ReceiveBlob into blobserver.Receive or blobserver.ReceiveNoHash
Change-Id: I9199555324b617167a6062a8b55ed09b449bae4f
2013-09-16 15:57:14 +01:00
Brad Fitzpatrick b24cad68dd Cleanup: remove BlobHub and time.Duration waits from storage interface
Move up a layer to the HTTP.  Also, start to remove ContextWrapper
stuff.  We've done it differently for App Engine instead, and will do
it differently yet moving forward.

Also add blobserver.Receive and use it in most places, moving checksum
verification up a layer.

Bunch of other cleanup and TODO fixing too.

Much simpler and cleaner.

Change-Id: I12e56c5d4e53bfcf82bdd8fb0b6d57c248ff605c
2013-08-21 13:57:28 -07:00
mpl 9fcb4b6434 dumpconfig: typo in date
Change-Id: Iebd75442070896b588092f8bad62e0d21cab3b27
2013-08-09 18:12:47 +02:00