pkg reorg

master
Paulo Simão 2021-11-16 21:26:51 -03:00
parent 502d1e5a7e
commit fecf1df963
7 changed files with 20 additions and 20 deletions

View File

@ -1,14 +1,14 @@
package main
import (
"go.digitalcircle.com.br/open/simplemq/lib/smqcli"
"go.digitalcircle.com.br/open/simplemq/lib/types"
"log"
"simplemq/lib/client"
"simplemq/lib/types"
"time"
)
func main() {
c, err := client.New("ws://localhost:8080/ws")
c, err := smqcli.New("ws://localhost:8080/ws")
if err != nil {
panic(err.Error())
}

View File

@ -2,16 +2,16 @@ package main
import (
"fmt"
"go.digitalcircle.com.br/open/simplemq/lib/smqcli"
"go.digitalcircle.com.br/open/simplemq/lib/types"
"log"
"runtime"
"simplemq/lib/client"
"simplemq/lib/types"
"time"
)
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
c, err := client.New("ws://localhost:8080/ws")
c, err := smqcli.New("ws://localhost:8080/ws")
if err != nil {
panic(err.Error())
}

View File

@ -2,14 +2,14 @@ package main
import (
"fmt"
"go.digitalcircle.com.br/open/simplemq/lib/smqcli"
"go.digitalcircle.com.br/open/simplemq/lib/types"
"log"
"simplemq/lib/client"
"simplemq/lib/types"
"time"
)
func main() {
c, err := client.New("ws://localhost:8080/ws")
c, err := smqcli.New("ws://localhost:8080/ws")
if err != nil {
panic(err.Error())
}

View File

@ -1,13 +1,13 @@
package main
import (
"go.digitalcircle.com.br/open/simplemq/lib/smqcli"
"log"
"simplemq/lib/client"
"time"
)
func main() {
c, err := client.New("ws://localhost:8080/ws")
c, err := smqcli.New("ws://localhost:8080/ws")
if err != nil {
panic(err.Error())
}

View File

@ -1,13 +1,13 @@
package main
import (
"go.digitalcircle.com.br/open/simplemq/lib/smqsvr"
"net/http"
"simplemq/lib/server"
)
func main() {
http.HandleFunc("/ws", server.Serve)
http.HandleFunc("/stats", server.Stats)
http.HandleFunc("/ws", smqsvr.Serve)
http.HandleFunc("/stats", smqsvr.Stats)
err := http.ListenAndServe(":8080", nil)
if err != nil {
panic(err)

View File

@ -1,13 +1,13 @@
package client
package smqcli
import (
"errors"
"fmt"
"github.com/gorilla/websocket"
"go.digitalcircle.com.br/open/simplemq/lib/random"
"go.digitalcircle.com.br/open/simplemq/lib/types"
"log"
"regexp"
"simplemq/lib/random"
"simplemq/lib/types"
"sync"
"time"
)

View File

@ -1,15 +1,15 @@
package server
package smqsvr
import (
"encoding/json"
"errors"
"fmt"
"github.com/gorilla/websocket"
"go.digitalcircle.com.br/open/simplemq/lib/random"
"go.digitalcircle.com.br/open/simplemq/lib/types"
"log"
"net/http"
"regexp"
"simplemq/lib/random"
"simplemq/lib/types"
"strings"
"sync"
"time"