Jeromy
206739d10c
allow channel marshaler to return errors from cmds.Response
...
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-04 14:12:19 -07:00
Jeromy
8286abaf8c
attempt at properly closing http response bodies
...
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-22 13:31:33 -07:00
W. Trevor King
663f37cb99
core/commands/unixfs/ls: Don't recurse into chunked files
...
Folks operating at the Unix-filesystem level shouldn't care about that
level of Merkle-DAG detail. Before this commit we had:
$ ipfs unixfs ls /ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4/busybox
/ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4/busybox:
... several lines of empty-string names ...
And with this commit we have:
$ ipfs unixfs ls /ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4/busybox
/ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4/busybox
I also reworked the argument-prefixing (object.Argument) in the output
marshaller to avoid redundancies like:
$ ipfs unixfs ls /ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4/busybox
/ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4/busybox:
/ipfs/QmSRCHG21Sbqm3EJG9aEBo4vS7Fqu86pAjqf99MyCdNxZ4/busybox
As a side-effect of this rework, we no longer have the trailing blank
line that we used to have after the final directory listing.
The new ErrImplementation is like Python's NotImplementedError, and is
mostly a way to guard against external changes that would need
associated updates in this code. For example, once we see something
that's neither a file nor a directory, we'll have to update the switch
statement to handle those objects.
License: MIT
Signed-off-by: W. Trevor King <wking@tremily.us>
2015-06-13 13:06:34 -07:00
Matt Bell
3fc9bedb0b
commands: Made Std{in|out|err} accessible in Request/Response
2015-01-23 18:29:31 -08:00
Matt Bell
6adebfad11
commands: Added Length field to Response
...
squash! commands: Added Length field to Response
commands/http: client: Fixed error on unset length
2015-01-23 18:29:29 -08:00
Matt Bell
31ae178078
commands: Support outputting <-chan interface{}
2015-01-21 04:28:02 +00:00
Matt Bell
2816ed038c
commands: Fixed panic when marshalers gave nil output
2015-01-06 15:55:18 -08:00
Matt Bell
0452a5f75e
commands: Made default JSON marshaler support channel output
2015-01-06 15:53:48 -08:00
Matt Bell
fd40702f73
commands: Changed Marshaler to return a io.Reader instead of a []byte
...
core/commands: Refactored command marshalers
2015-01-06 15:53:42 -08:00
Juan Batiz-Benet
047d2e2d62
cmd2: Marshaller -> Marshaler (see golang/encoding)
...
Also:
- map[cmds.EncodingType]cmds.Marshaller -> MarshalMap
cc @mappum @maybebtc
2014-11-14 03:20:05 -08:00
Juan Batiz-Benet
7daf888902
cmds2: handle error return codes
2014-11-14 03:20:03 -08:00
Brian Tiger Chow
69374b30be
refactor(commands/optionvalue) use
...
@mappum this optionvalue is a really great abstraction. It makes
maintenance super simple!
@jbenet @whyrusleeping
2014-11-14 03:19:57 -08:00
Matt Bell
f1fc26e70b
commands: Removed a fmt.Println
2014-11-14 03:17:38 -08:00
Matt Bell
3e507f7c9f
commands: Changed option accessor API (Request#Option now returns an OptionValue)
2014-11-14 03:17:38 -08:00
Matt Bell
20285ead82
commands: Indent JSON-marshalled Response output
2014-11-14 03:17:34 -08:00
Matt Bell
db9c7f7c29
commands: Fixed panic when trying to marshal without a command set in request
2014-11-04 02:04:51 -08:00
Matt Bell
2a1116cec8
commands: Allow overriding marshaller for any encoding type
2014-11-04 02:04:50 -08:00
Matt Bell
33ad56e6d0
commands: Safer type coercion when choosing marshaller
2014-11-04 02:04:50 -08:00
Matt Bell
0149f65c6c
commands: Replaced 'Formatter' with 'Marshaller'
2014-11-04 02:04:50 -08:00
Matt Bell
f6c38882f0
commands: Return a reader in a Response#Reader method, instead of making Response implementing io.Reader
2014-11-04 02:04:49 -08:00
Matt Bell
69a56de040
commands: Renamed Response#Value to Response#Output
2014-11-04 02:04:49 -08:00
Matt Bell
b61cfd9224
commands: Don't error when marshalling empty Responses
2014-11-04 02:04:47 -08:00
Matt Bell
b54801cc10
commands: Added plaintext marshalling to Response#Marshal()
2014-11-04 02:04:46 -08:00
Matt Bell
e8b37acda3
commands: Simplified Error string output
2014-11-04 02:04:44 -08:00
Matt Bell
3cebd2176e
commands: Made Response implement io.Reader
2014-11-04 02:04:44 -08:00
Matt Bell
94683bb6b2
commands: Removed unused output stream field from Response
2014-11-04 02:04:43 -08:00
Matt Bell
19e5fbae70
commands: Made Response#Error return an *Error instead of an error
2014-11-04 02:04:43 -08:00
Juan Batiz-Benet
d464e3d143
commands: go fmt
2014-10-21 18:16:04 -07:00
Matt Bell
dd84a3eb44
commands: Got rid of Response#Stream() in favor of setting value to a io.Reader
2014-10-21 16:15:06 -07:00
Matt Bell
b65a5bacbe
commands: Made Error implement error interface
2014-10-21 15:25:47 -07:00
Matt Bell
7bd7ed6d52
commands: Added output stream field to Response
2014-10-20 14:38:36 -07:00
Juan Batiz-Benet
b10fc2cc50
turned req + res into interfaces
2014-10-20 11:49:07 -07:00
Juan Batiz-Benet
bbef82f4fa
"enc" -> EncShort
2014-10-20 08:00:28 -07:00
Juan Batiz-Benet
7673ce6f65
fmt, lint, + vet commands/
2014-10-20 07:53:14 -07:00
Matt Bell
e5e121a6b1
commands: Made Request#Option also return an existence bool
2014-10-20 07:04:54 -07:00
Matt Bell
43670971d8
commands: Formatted code
2014-10-20 07:04:52 -07:00
Matt Bell
aa592cec80
commands: Added error marshalling to Response
2014-10-20 07:04:51 -07:00
Matt Bell
a3a843759b
commands: Added marshalling to Response
2014-10-20 07:04:51 -07:00
Matt Bell
95b0dd29f8
commands: Added an Error struct for creating marshallable errors
2014-10-20 07:04:51 -07:00
Matt Bell
f31fd53df9
commands: Added Response
2014-10-20 07:04:50 -07:00