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 package main
import ( import (
"go.digitalcircle.com.br/open/simplemq/lib/smqcli"
"go.digitalcircle.com.br/open/simplemq/lib/types"
"log" "log"
"simplemq/lib/client"
"simplemq/lib/types"
"time" "time"
) )
func main() { func main() {
c, err := client.New("ws://localhost:8080/ws") c, err := smqcli.New("ws://localhost:8080/ws")
if err != nil { if err != nil {
panic(err.Error()) panic(err.Error())
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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