1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-04 05:16:23 +08:00

64 Commits

Author SHA1 Message Date
5706471897 commands: Made PostRun signature match Run 2015-01-23 18:29:31 -08:00
7b4de230eb commands: Refactored Command#Run function signature to (req Request, res Response) 2015-01-23 18:29:29 -08:00
856d2896a7 commands: Added PreRun function to command 2015-01-23 18:19:40 -08:00
1281b25105 commands: Added PostRun function, called on the client 2015-01-23 18:19:40 -08:00
7294f6334a commands: Removed old TODOs 2015-01-23 18:19:39 -08:00
31ae178078 commands: Support outputting <-chan interface{} 2015-01-21 04:28:02 +00:00
0419ce1d20 commands: Removed unused cleanup function 2015-01-06 15:55:17 -08:00
c2f46b618a commands: Fixed panic on nil output value 2015-01-06 15:55:17 -08:00
69999bd0a7 commands: Allow commands to output pointers to specified type 2015-01-06 15:53:49 -08:00
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
bbf3a1f4d4 commands: Changed Option to an interface 2014-11-19 00:24:55 -08:00
bc8a97c119 commands: Cleanup up argument validation 2014-11-18 02:13:55 -08:00
9dcf21673d commands: Fail earlier for arg count checking (by doing it in CLI req parser) 2014-11-18 02:13:55 -08:00
4ba7408363 commands: Don't error on file arg checking (for now) 2014-11-18 02:13:54 -08:00
ef0826acd6 fix(commands/err)
I didn't know there were dragons here.

When casting errors we've gotta be careful. Apparently both values and
pointers satisfy the error interface. Type checking for one doesn't
catch the other.

cc @whyrusleeping @mappum @jbenet

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:20:07 -08:00
ca2828f33c feat(commands) add ClientError(msg) helper and use it to return a fancy error to the client in the tour
@jbenet this exists now

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:20:07 -08:00
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
3b407c705d commands: Ensure command output is correct type (if cmd.Type is set), resolves #321 2014-11-14 03:20:05 -08:00
646920b0dd commands: Got rid of old helptext fields, use HelpText struct fields in helptext generator 2014-11-14 03:20:05 -08:00
fc7c199d6a cmds/helptext: indent + newlines + synopsis 2014-11-14 03:20:00 -08:00
475f3f485b commands: Added HelpText struct to organize different help text fields in Commands 2014-11-14 03:19:59 -08:00
81dbb23602 commands: Cleanup Requests after command execution returns 2014-11-14 03:17:43 -08:00
ea15bd6ffe docs(commands) amend 2014-11-14 03:17:41 -08:00
e6f2de40dc docs(commands) Type 2014-11-14 03:17:41 -08:00
7666f8880c commands: Allow overriding helptext sections with hand-written strings 2014-11-14 03:17:41 -08:00
50751617b6 commands: s/j/valueIndex/ 2014-11-14 03:17:40 -08:00
eedc2e9cc7 commands: s/lenRequired/numRequired/ 2014-11-14 03:17:40 -08:00
3e507f7c9f commands: Changed option accessor API (Request#Option now returns an OptionValue) 2014-11-14 03:17:38 -08:00
2029168e98 commands: Made Command run functions return (interface{}, error) instead of setting the values in the response 2014-11-14 03:17:37 -08:00
351ed9589a commands: Added 'Description' fields to Command, Argument, Option 2014-11-14 03:17:33 -08:00
fecb434ab4 commands: Fixed arg validation bug 2014-11-14 03:17:27 -08:00
116041c5ec commands: Fixed argument value/definition mapping 2014-11-14 03:17:26 -08:00
2a1116cec8 commands: Allow overriding marshaller for any encoding type 2014-11-04 02:04:50 -08:00
0149f65c6c commands: Replaced 'Formatter' with 'Marshaller' 2014-11-04 02:04:50 -08:00
bc6938dc08 commands: Cleaned up argument validation 2014-11-04 02:04:49 -08:00
75649f3d49 commands: Moved argument checking into a Command method, fail early when parsing commands 2014-11-04 02:04:49 -08:00
e8d0cbff1d commands: Check argument validity when running commands 2014-11-04 02:04:49 -08:00
827f1dd0b0 commands: Changed Request arguments to a []interface{} 2014-11-04 02:04:48 -08:00
83b2ba00e9 commands: Removed Command#Private field 2014-11-04 02:04:48 -08:00
460387fc3b commands: Added 'Private' field to Command 2014-11-04 02:04:47 -08:00
4911dc069a refactor(commands) swap argument order to match Http(w, r) idiom 2014-11-04 02:04:47 -08:00
ef290faa88 commands: Added a Type field for defining output struct formats 2014-11-04 02:04:46 -08:00
38f8f1c279 commands: Added a Format function to Command, for creating human-readable output based on a Response 2014-11-04 02:04:46 -08:00
ca44d0da2c commands: Removed Command#Register and exported Subcommands so subcommands can be defined statically 2014-10-21 18:05:54 -07:00
6ff98df9c1 commands: Do command collision check in GetOptions 2014-10-21 18:00:26 -07:00
dd84a3eb44 commands: Got rid of Response#Stream() in favor of setting value to a io.Reader 2014-10-21 16:15:06 -07:00
4896123c14 commands: Export command Run function 2014-10-21 15:24:39 -07:00
7bd7ed6d52 commands: Added output stream field to Response 2014-10-20 14:38:36 -07:00
b10fc2cc50 turned req + res into interfaces 2014-10-20 11:49:07 -07:00
92528ba764 Sub -> Subcommand 2014-10-20 07:55:23 -07:00