Conversation
This way you don't have to set it when attaching the watcher
…e/more-server-options
…e/more-server-options
…e/more-server-options
…e/more-server-options
…-options' into feature/json-watcher
…e/json-watcher # Conflicts: # src/bin/main.rs
…e/http # Conflicts: # src/bin/server.rs # src/watchers/mod.rs
…e/http # Conflicts: # examples/test.eve # src/bin/server.rs
Feature/json watcher
joshuafcole
left a comment
There was a problem hiding this comment.
I haven't really looked through the http stuff yet but there's some work to do first
examples/json-demo.eve
Outdated
| entity? = if eav = [#json/encode/entity] then "entity" | ||
| else "" | ||
| bind | ||
| encode <- [| children: |
There was a problem hiding this comment.
no pipe required when merging (you can't change the identity of an existing thing!)
examples/json-demo.eve
Outdated
| encode = [#flatten] | ||
| [#json/encode/flatten record] | ||
| bind | ||
| encode <- [| children: |
libraries/groove/groove.eve
Outdated
| Create a Groove user from the response | ||
|
|
||
| search | ||
| [#groove-profile json-object: profile] |
There was a problem hiding this comment.
shouldn't this be #groove/profile?
libraries/groove/groove.eve
Outdated
| end | ||
|
|
||
| search | ||
| [#groove-search query response: [body]] |
libraries/groove/groove.eve
Outdated
| end | ||
|
|
||
| search | ||
| [#groove-get-song track response: [body]] |
libraries/json/json.eve
Outdated
|
|
||
| ### Bring it all together | ||
|
|
||
| Join all encoded avs into a compelte string |
| complete-av = [#json/encode/complete-av record] | ||
| target-record = [#json/encode/record record] | ||
| bind | ||
| [#string/join #json/encode/join-complete record with: ", " | strings: complete-av.json-string] |
There was a problem hiding this comment.
we can switch to gather/string-join now
There was a problem hiding this comment.
I had some issues getting it to work the way I expected. I think I need a description on the parameters.
| runner.program.attach(Box::new(WebsocketClientWatcher::new(out.clone(), client_name))); | ||
| runner.program.attach(Box::new(ConsoleWatcher::new())); | ||
| runner.program.attach(Box::new(PanicWatcher::new())); | ||
| runner.program.attach(Box::new(JsonWatcher::new(outgoing.clone()))); |
There was a problem hiding this comment.
looks like it got added twice?
| pub fn string_encode(params: Vec<&Internable>) -> Option<Internable> { | ||
| match params.as_slice() { | ||
| &[&Internable::String(ref text)] => Some(Internable::String(base64::encode(text.as_bytes()))), | ||
| _ => None |
There was a problem hiding this comment.
should probably return numbers as a string of themselves here?
| pub fn string_urlencode(params: Vec<&Internable>) -> Option<Internable> { | ||
| match params.as_slice() { | ||
| &[&Internable::String(ref text)] => Some(Internable::String(urlencoding::encode(text))), | ||
| _ => None |
There was a problem hiding this comment.
should probably return numbers as a string of themselves here?
No description provided.