Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
hwholiday committed Aug 29, 2018
1 parent 1badc99 commit 12367af
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@

prometheus 测试项目

goquery 测试项目
goquery 测试项目

gin -p=3000 -a=8070 run main.go
8 changes: 4 additions & 4 deletions gin/conf/mysql.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"mysqluser":"123123",
"mysqlpass":"123",
"mysqlurl":"123.123.123.123",
"mysqluser":"root",
"mysqlpass":"nihao123,./",
"mysqlurl":"192.168.2.15",
"mysqlport":"3306",
"mysqldb":"howie"
"mysqldb":"online"
}
2 changes: 1 addition & 1 deletion other/howie.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import "fmt"

func main(){
func main1(){
Add()
}

Expand Down
6 changes: 3 additions & 3 deletions other/mian.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"log"
)

func main1() {
func main() {
http.HandleFunc("/test", func(writer http.ResponseWriter, request *http.Request) {
writer.Write([]byte("ok"))
writer.Write([]byte("ok1"))
})
http.Handle("/", http.FileServer(http.Dir("./")))
log.Println("服务器启动成功端口:", 8070)
log.Println("服务器启动成功端口:", 3001)
err := http.ListenAndServe(":8070", nil)
if err != nil {
log.Panic(err)
Expand Down
9 changes: 4 additions & 5 deletions push/push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ import (
"fmt"
"github.com/gorilla/websocket"
"log"
"test/push/handler"
"os"
"os/signal"
"encoding/json"
)

func Test(t *testing.T) {
i := 0
for {
i++
if i == 1000 {
if i == 100000 {
fmt.Println("已经了解10000个链接")
break
}
time.Sleep(time.Second)
Expand All @@ -29,7 +28,7 @@ func Test(t *testing.T) {
return
}
defer c.Close()
go func() {
/*go func() {
for {
time.Sleep(time.Second * 30)
data, err := json.Marshal(handler.ClientsReport{id, 1, "hahh"})
Expand All @@ -44,7 +43,7 @@ func Test(t *testing.T) {
}
}
}()
}()*/
for {
_, _, err := c.ReadMessage()
if err != nil {
Expand Down

0 comments on commit 12367af

Please sign in to comment.