30 Commits

Author SHA1 Message Date
Michael Vogt
277eb06412 many: replace use of "sanity" with more inclusive naming
This commit replaces the use of "sanity" with more inclusive
naming.

When `sanity` is used in a more general sense either `validity`
or `quick` is used.
2022-03-14 18:22:34 +01:00
Samuele Pedroni
54e84fb8db many: fix imports order (according to gci)
had to make the comment in wrappers/services_test.go a one-liner
otherwise half of it is lost

last set of files needing changing (as per current master)
2021-06-16 09:54:31 +02:00
Samuele Pedroni
cae1508d0a client: cleanup the Client.raw* and Client.do* method families
* they now can take a *doOptions uniformly to control timeout:
  - nil or absence uses the defaults
  - there's a predefined doNoTimeoutAndRetry to get no timeout
* there's a simple and a full parameter only variant of doSync and doAsync
* use rawWithTimeout in the places that were using raw but setting
  a timeout via context themselves
2020-10-01 22:36:16 +02:00
Michael Vogt
b96d24e817 client: add xerrors and wrap errors coming from "client"
This PR makes the error handling via xerrors in the "client"
package consistent. All errors from client.{doSync,raw} are
wrapped using %w from the xerrors package. Once this is
wrapped this is part of the API so tests were added to ensure
we don't regress here.
2019-10-23 13:38:51 +02:00
Michael Vogt
b06420da8e client: add KnownOptions to Know() and support remote assertions
The daemon can query remote assertions from the store now. This
PR adds support for this to the client package via a new
KnownOptions parameter to the client.Known() call. This breaks
API which should be ok given that its a internal client API.

If this is a problem we can use #7573
2019-10-09 08:41:26 +02:00
Maciej Borzecki
6010e91d48 Merge remote-tracking branch 'upstream/master' into client-hangs-forever 2019-09-25 09:54:14 +02:00
Ian Johnson
608ccf0925 client/asserts.go: move to client/store.go
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2019-09-12 12:06:10 -05:00
Maciej Borzecki
9581f7c7cb client: refactor timeout handling, timeout context covers reception of response body
Make sure that the timeout context spans over the reception of response body.
Otherwise, reading of response body may error out, if there is more data than
the default receive buffer.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2019-08-20 14:31:55 +02:00
Michael Vogt
46bd9e17bf client: use a context for the timeout and fix snap logs -f
We cannot use a timeout everywhere because this would break
`snap logs -f` - so this commit makes "raw" take a timeout and
use "0" in the Logs call.
2019-07-25 17:54:59 +02:00
John R. Lenton
e4e597a772 cmd/snap: move "known" completion to use the client lib 2017-07-25 15:47:26 +01:00
John R. Lenton
9c51ec7f4c many: support querying and completing assertion type names 2017-06-30 10:13:04 +01:00
Samuele Pedroni
1383502775 many: switch to use http numeric statuses as agreed (#3486)
- replace http.Status* with well-known numeric values in tests
- store: replace http.Status* with well-known numeric values and dont' convert 401 into please buy, atm is just confusing
- replace http.Status* with well-known numeric values in retry checks
- replace http.Status* with well-known numeric values in fake services
- run-check static check
- replace http.Status* with well-known numeric values in client and daemon
2017-06-16 00:25:33 +02:00
Michael Vogt
ea67f7c610 make error passing better 2016-10-19 14:10:34 +02:00
Michael Vogt
247f3451db avoid horrible string matching 2016-10-19 12:19:40 +02:00
Gustavo Niemeyer
2dbc8a4c35 Code moved to github.com/snapcore/snapd. 2016-05-24 09:26:23 -03:00
Gustavo Niemeyer
1353dd22ce Set proper content-type for multipart upload. 2016-04-15 19:12:34 -03:00
Gustavo Niemeyer
b9883d7d35 daemon,client,cmd: have snaps directly at result 2016-04-13 20:04:53 -03:00
John R. Lenton
cb6606ba06 daemon, client, cmd/snap, notifications, integration-tests, docs: use v2, not 2.0, for api endpoint 2016-03-29 12:10:23 +01:00
Samuele Pedroni
c0c67f7026 rename cmd 'snap asserts' to 'snap known' 2016-02-23 17:46:54 +01:00
Samuele Pedroni
738d1b2546 rename cmd 'snap assert' to 'snap ack' 2016-02-23 17:15:11 +01:00
Samuele Pedroni
b307d3eba0 tweak doc comment 2016-02-01 13:52:41 +01:00
Samuele Pedroni
988ff3fff4 follow the convention for X- headers 2016-01-28 17:23:11 +01:00
Samuele Pedroni
239c41b1fe make use of X-Assertions-Count 2016-01-28 17:19:37 +01:00
Samuele Pedroni
1569745a97 adapt to new interface 2016-01-28 15:23:12 +01:00
Samuele Pedroni
555e14ff8d Merge remote-tracking branch 'chipaca/use-opaque-in-client-internals' into asserts-client-daemon-asserts-query 2016-01-28 14:35:12 +01:00