Skip to content

Added wrapper around result (gotalk) #1

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emmaly
Copy link

@emmaly emmaly commented May 24, 2017

This is regarding gotalk:

Added Result type, WrapResult func, Result.Result(), Result.Error(). This allows the JavaScript client to send responses back to the server when the JS is hosting the request.

Example of use:

gotalk.Handle("greet", func(in string, out *js.Object) {
	console.log("You've been greeted: " + in)
	r := gotalk.WrapResult(out)
	if rand.Intn(1) == 1 {
		r.Result({"greeting": "Greetings and/or Salutations!"})
	} else {
		r.Error("Sir, I said Good Day.")
	}
})

Added Result type, WrapResult func, Result.Result(), Result.Error().  This allows the JavaScript client to send responses back to the server when the JS is hosting the request.
@emmaly emmaly changed the title Added wrapper around result Added wrapper around result (gotalk) May 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant