basic app
This commit is contained in:
parent
0a6e246a5c
commit
8d6c2b6687
30 changed files with 1469 additions and 0 deletions
21
internal/app/client.go
Normal file
21
internal/app/client.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package app
|
||||
|
||||
import (
|
||||
log "github.com/sirupsen/logrus"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
pb "parsing-service/proto/taskProcessor"
|
||||
)
|
||||
|
||||
func newClient(app *App) pb.TaskProcessorClient {
|
||||
var opts []grpc.DialOption
|
||||
insec := grpc.WithTransportCredentials(insecure.NewCredentials())
|
||||
opts = append(opts, insec)
|
||||
|
||||
conn, err := grpc.NewClient(app.ClientAddress, opts...)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
return pb.NewTaskProcessorClient(conn)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue