MCPcopy
hub / github.com/nats-io/nats.go / ExampleRequest_Respond

Function ExampleRequest_Respond

micro/example_test.go:329–338  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

327}
328
329func ExampleRequest_Respond() {
330 handler := func(req micro.Request) {
331 // respond to the request
332 if err := req.Respond(req.Data()); err != nil {
333 log.Fatal(err)
334 }
335 }
336
337 fmt.Printf("%T", handler)
338}
339
340func ExampleRequest_RespondJSON() {
341 type Point struct {

Callers

nothing calls this directly

Calls 2

RespondMethod · 0.65
DataMethod · 0.65

Tested by

no test coverage detected