From fecf1df963b1700d2b44739895007f6c331ec545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulo=20Sima=CC=83o?= Date: Tue, 16 Nov 2021 21:26:51 -0300 Subject: [PATCH] pkg reorg --- cmd/recv/main.go | 6 +++--- cmd/rpccli/main.go | 6 +++--- cmd/rpcserver/main.go | 6 +++--- cmd/send/main.go | 4 ++-- cmd/server/main.go | 6 +++--- {lib/client => smqcli}/lib.go | 6 +++--- {lib/server => smqsvr}/lib.go | 6 +++--- 7 files changed, 20 insertions(+), 20 deletions(-) rename {lib/client => smqcli}/lib.go (96%) rename {lib/server => smqsvr}/lib.go (97%) diff --git a/cmd/recv/main.go b/cmd/recv/main.go index f7999ed..8dd4953 100644 --- a/cmd/recv/main.go +++ b/cmd/recv/main.go @@ -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()) } diff --git a/cmd/rpccli/main.go b/cmd/rpccli/main.go index 3a778a1..29ca1fd 100644 --- a/cmd/rpccli/main.go +++ b/cmd/rpccli/main.go @@ -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()) } diff --git a/cmd/rpcserver/main.go b/cmd/rpcserver/main.go index cec89ed..da113f9 100644 --- a/cmd/rpcserver/main.go +++ b/cmd/rpcserver/main.go @@ -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()) } diff --git a/cmd/send/main.go b/cmd/send/main.go index a73d171..74d96e6 100644 --- a/cmd/send/main.go +++ b/cmd/send/main.go @@ -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()) } diff --git a/cmd/server/main.go b/cmd/server/main.go index 7b02f44..fddcc4e 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -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) diff --git a/lib/client/lib.go b/smqcli/lib.go similarity index 96% rename from lib/client/lib.go rename to smqcli/lib.go index 18275c5..f91e636 100644 --- a/lib/client/lib.go +++ b/smqcli/lib.go @@ -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" ) diff --git a/lib/server/lib.go b/smqsvr/lib.go similarity index 97% rename from lib/server/lib.go rename to smqsvr/lib.go index 86c8aef..89d4664 100644 --- a/lib/server/lib.go +++ b/smqsvr/lib.go @@ -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"