Commit 92f73072 authored by Mike Jones's avatar Mike Jones

Move ioman/echotest to its own module

parent 3123dbb8
FROM golang:latest
WORKDIR /go/src/echotest
COPY . .
RUN go clean
RUN go get -d -v ./...
RUN go install -v ./...
CMD ["echotest", "-url=nats://nasty-nate-nats-headless:4222"]
\ No newline at end of file
# modexample
:spanner: A bare-bones example module.
\ No newline at end of file
:hammer_and_wrench: A bare-bones example module.
docker build . --tag=echotest:latest
docker tag echotest:latest gcr.io/stella-irc/echotest:latest
docker push gcr.io/stella-irc/echotest:latest
\ No newline at end of file
package main
import (
"fmt"
goschema "git.netsplit.uk/stella-irc/ioman/pkg/dragcarschema"
messaging "git.netsplit.uk/stella-irc/ioman/pkg/messaging"
)
func main() {
proxy := messaging.NewNATSProxy()
listenAndRespond(proxy)
}
func listenAndRespond(proxy messaging.IMessageProxy) {
inCh, _ := proxy.BindRecv("messaging.input")
outCh, _ := proxy.BindSend("messaging.output")
for m := range inCh {
if m != nil {
outCh <- &goschema.IRCMessage{Target: m.Target, Raw: fmt.Sprintf("Did you say %s?", m.Raw)}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment