-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reverse order of return variables for protocol; remove knowledge of c…
…lient in channel
- Loading branch information
1 parent
4249e40
commit 7ae6823
Showing
10 changed files
with
115 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
nsq | ||
nsq_server/nsq_server | ||
nsq_lookup/nsq_lookup | ||
nsq_admin/nsq_admin | ||
|
||
# Go.gitignore | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
Install instructions | ||
|
||
cd nsq_server | ||
go build | ||
|
||
cd ../nsq_admin | ||
go build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"log" | ||
"io" | ||
"strconv" | ||
"net/http" | ||
"time" | ||
) | ||
|
||
var bindAddress = flag.String("address", "", "address to bind to") | ||
var webPort = flag.Int("web-port", 5152, "port to listen on for HTTP connections") | ||
var debugMode = flag.Bool("debug", false, "enable debug mode") | ||
|
||
func pingHandler(w http.ResponseWriter, req *http.Request) { | ||
w.Header().Set("Content-Length", "2") | ||
io.WriteString(w, "OK") | ||
} | ||
|
||
func main() { | ||
flag.Parse() | ||
fqAddress := *bindAddress + ":" + strconv.Itoa(*webPort) | ||
log.Printf("listening for http requests on %s", fqAddress) | ||
s := &http.Server{ | ||
Addr: fqAddress, | ||
Handler: http.DefaultServeMux, | ||
ReadTimeout: 10 * time.Second, | ||
WriteTimeout: 10 * time.Second, | ||
MaxHeaderBytes: 1 << 20, | ||
} | ||
http.HandleFunc("/ping", pingHandler) | ||
http.Handle("/static", http.FileServer(http.Dir("static"))) | ||
log.Fatal(s.ListenAndServe()) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
package main | ||
|
||
import ( | ||
"./message" | ||
"./server" | ||
"./util" | ||
"../message" | ||
"../server" | ||
"../util" | ||
"flag" | ||
"log" | ||
"os" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.