18 lines
348 B
Go
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
|
|
}
|