ezshare/client/client.go

18 lines
348 B
Go
Raw Normal View History

2021-12-03 22:04:09 +00:00
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
}