2019-07-18 14:10:43 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
2019-07-29 14:08:13 +00:00
|
|
|
"strconv"
|
2019-07-19 07:39:53 +00:00
|
|
|
|
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 (
|
2019-07-29 14:08:13 +00:00
|
|
|
server *internal.Server
|
|
|
|
defaultPortNumber = 8008
|
2019-07-18 14:10:43 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2019-07-29 14:08:13 +00:00
|
|
|
var err error
|
|
|
|
server, err = internal.NewServer(defaultPortNumber)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2019-07-18 14:10:43 +00:00
|
|
|
server.Address = "localhost"
|
2019-07-21 09:43:14 +00:00
|
|
|
server.Backend = memory.NewBackend(server.Address)
|
2019-07-18 14:10:43 +00:00
|
|
|
server.Backend.Register("andrew", "1", "")
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
2019-07-29 14:08:13 +00:00
|
|
|
log.Println("Server started on port " + strconv.Itoa(defaultPortNumber))
|
2019-07-18 14:10:43 +00:00
|
|
|
log.Println(server.Run())
|
|
|
|
}
|