first commit
This commit is contained in:
commit
f2a577f98c
23
.gitignore
vendored
Normal file
23
.gitignore
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Created by .ignore support plugin (hsz.mobi)
|
||||
### Go template
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, build with `go test -c`
|
||||
*.test
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
|
||||
.glide/
|
||||
|
||||
.gitignore 제거할 예정
|
||||
.idea/ 제거할 예정
|
||||
collector.go 제거할 예정
|
||||
|
||||
.idea/
|
||||
*.iml
|
41
collector.go
Normal file
41
collector.go
Normal file
|
@ -0,0 +1,41 @@
|
|||
package collector_go
|
||||
|
||||
import (
|
||||
g "loafle.com/overflow/crawler_go/grpc"
|
||||
"google.golang.org/grpc"
|
||||
"log"
|
||||
"context"
|
||||
|
||||
)
|
||||
|
||||
|
||||
const (
|
||||
address = "192.168.1.105:50052"
|
||||
)
|
||||
|
||||
func CallGet() {
|
||||
|
||||
conn, err := grpc.Dial(address, grpc.WithInsecure())
|
||||
if err != nil {
|
||||
log.Fatalf("did not connect: %v", err)
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
|
||||
dc := g.NewDataClient(conn);
|
||||
|
||||
in := &g.Input{}
|
||||
|
||||
in.Id = ""
|
||||
in.Name = g.Crawlers_HEALTH_DNS
|
||||
|
||||
|
||||
|
||||
out, err := dc.Get(context.Background(), in)
|
||||
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
log.Println(out)
|
||||
|
||||
}
|
12
collector_test.go
Normal file
12
collector_test.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
package collector_go
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestCallGet(t *testing.T) {
|
||||
|
||||
CallGet()
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user