-
Notifications
You must be signed in to change notification settings - Fork 31
Feature/json-watcher #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drop the pipe
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be #groove/profile?
libraries/groove/groove.eve
Outdated
| end | ||
|
|
||
| search | ||
| [#groove-search query response: [body]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#groove/search?
libraries/groove/groove.eve
Outdated
| end | ||
|
|
||
| search | ||
| [#groove-get-song track response: [body]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#groove/get-song?
libraries/json/json.eve
Outdated
|
|
||
| ### Bring it all together | ||
|
|
||
| Join all encoded avs into a compelte string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compelte
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can switch to gather/string-join now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably return numbers as a string of themselves here?
No description provided.