signaller/cmd/main.go

31 lines
575 B
Go
Raw Normal View History

2019-07-18 14:10:43 +00:00
package main
import (
"log"
"strconv"
2019-07-20 16:33:02 +00:00
"github.com/nxshock/signaller/internal"
"github.com/nxshock/signaller/internal/backends/memory"
2019-07-18 14:10:43 +00:00
)
var (
server *internal.Server
defaultPortNumber = 8008
2019-07-18 14:10:43 +00:00
)
func init() {
var err error
server, err = internal.NewServer(defaultPortNumber)
if err != nil {
panic(err)
}
2019-07-18 14:10:43 +00:00
server.Address = "localhost"
server.Backend = memory.NewBackend(server.Address)
2019-07-18 14:10:43 +00:00
server.Backend.Register("andrew", "1", "")
}
func main() {
log.Println("Server started on port " + strconv.Itoa(defaultPortNumber))
2019-07-18 14:10:43 +00:00
log.Println(server.Run())
}