parcoursmob/services/solidarity_service.go

24 lines
532 B
Go
Raw Permalink Normal View History

2024-07-31 16:33:25 +00:00
package services
import (
2024-08-07 13:01:01 +00:00
solidarityservice "git.coopgo.io/sbouaram/solidarity-service/servers/grpc/proto"
2024-08-02 13:02:35 +00:00
"google.golang.org/grpc"
2024-07-31 16:33:25 +00:00
)
2024-08-02 13:02:35 +00:00
type SolidarityService struct {
2024-08-07 13:01:01 +00:00
solidarityservice.SolidarityServiceClient
2024-08-02 13:02:35 +00:00
}
2024-07-31 16:33:25 +00:00
2024-08-02 13:02:35 +00:00
func NewSolidarityService(silvermobiDial string) (*SolidarityService, error) {
conn, err := grpc.Dial(silvermobiDial, grpc.WithInsecure())
2024-07-31 16:33:25 +00:00
2024-08-07 13:01:01 +00:00
client := solidarityservice.NewSolidarityServiceClient(conn)
2024-08-02 13:02:35 +00:00
if err != nil {
return nil, err
}
2024-07-31 16:33:25 +00:00
2024-08-02 13:02:35 +00:00
return &SolidarityService{
SolidarityServiceClient: client,
}, nil
}