(ctx ofctx.Context, in []byte)
| 8 | ) |
| 9 | |
| 10 | func ForwardToKafka(ctx ofctx.Context, in []byte) (ofctx.Out, error) { |
| 11 | var greeting []byte |
| 12 | if in != nil { |
| 13 | log.Printf("http - Data: %s", in) |
| 14 | greeting = in |
| 15 | } else { |
| 16 | log.Print("http - Data: Received") |
| 17 | greeting, _ = json.Marshal(map[string]string{"message": "Hello"}) |
| 18 | } |
| 19 | |
| 20 | _, err := ctx.Send("kafka-server", greeting) |
| 21 | if err != nil { |
| 22 | log.Print(err.Error()) |
| 23 | return ctx.ReturnOnInternalError(), err |
| 24 | } |
| 25 | |
| 26 | return ctx.ReturnOnSuccess(), nil |
| 27 | } |
nothing calls this directly
no outgoing calls
no test coverage detected