mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-05-23 07:16:39 +00:00

This is the quasi-standard and fixes the error below: ``` $ go get -u github.com/planetmint/planetmint-go@v0.1.0 go: github.com/planetmint/planetmint-go@v0.1.0: parsing go.mod: module declares its path as: planetmint-go but was required as: github.com/planetmint/planetmint-go ``` Signed-off-by: Julian Strobl <jmastr@mailbox.org>
30 lines
721 B
Go
30 lines
721 B
Go
package keeper
|
|
|
|
import (
|
|
config "github.com/planetmint/planetmint-go/config"
|
|
"strconv"
|
|
|
|
"github.com/cometbft/cometbft/libs/log"
|
|
"github.com/hypebeast/go-osc/osc"
|
|
)
|
|
|
|
func (k Keeper) IssueResponseHandler(logger log.Logger) {
|
|
conf := config.GetConfig()
|
|
addr := "0.0.0.0:" + strconv.FormatInt(int64(conf.OSCServicePort), 10)
|
|
d := osc.NewStandardDispatcher()
|
|
err := d.AddMsgHandler("/rddl/resp", func(msg *osc.Message) {
|
|
logger.Info("Issue Response: " + msg.String())
|
|
})
|
|
if err != nil {
|
|
logger.Error("Unable to add handler to OSC service.")
|
|
}
|
|
server := &osc.Server{
|
|
Addr: addr,
|
|
Dispatcher: d,
|
|
}
|
|
err = server.ListenAndServe()
|
|
if err != nil {
|
|
logger.Error("Unable to start the OSC service.")
|
|
}
|
|
}
|