[wip] renamed base package grpc

This commit is contained in:
Adphi 2020-01-22 21:20:18 +01:00
parent 8197d933f8
commit d2ee153290
2 changed files with 8 additions and 8 deletions

View File

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"time" "time"
service2 "gitlab.bertha.cloud/partitio/grpc-service/service" "gitlab.bertha.cloud/partitio/grpc/service"
) )
type GreeterHandler struct{} type GreeterHandler struct{}
@ -30,16 +30,16 @@ func (g *GreeterHandler) SayHelloStream(req *HelloStreamRequest, s Greeter_SayHe
func main() { func main() {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel() defer cancel()
var svc service2.Service var svc service.Service
var err error var err error
svc, err = service2.New( svc, err = service.New(
service2.WithContext(ctx), service.WithContext(ctx),
service2.WithName("Greeting"), service.WithName("Greeting"),
service2.WithAfterStart(func() error { service.WithAfterStart(func() error {
fmt.Println("Server listening on", svc.Options().Address()) fmt.Println("Server listening on", svc.Options().Address())
return nil return nil
}), }),
service2.WithAfterStop(func() error { service.WithAfterStop(func() error {
fmt.Println("Stopping server") fmt.Println("Stopping server")
return nil return nil
}), }),

2
go.mod
View File

@ -1,4 +1,4 @@
module gitlab.bertha.cloud/partitio/grpc-service module gitlab.bertha.cloud/partitio/grpc
go 1.13 go 1.13