ezshare/client/client.go
2021-12-03 23:05:29 +01:00

18 lines
348 B
Go

package client
import (
"context"
"gitea.benny.dog/torjus/ezshare/pb"
"google.golang.org/grpc"
)
func NewClient(ctx context.Context, addr string) (pb.FileServiceClient, error) {
conn, err := grpc.DialContext(ctx, addr, grpc.WithInsecure())
if err != nil {
return nil, err
}
client := pb.NewFileServiceClient(conn)
return client, nil
}