removed dependencies

This commit is contained in:
2023-08-13 00:09:57 +03:00
parent dc0c660021
commit 85d1191dd9
15 changed files with 117 additions and 275 deletions

View File

@@ -72,7 +72,7 @@ func (c *client) Done() <-chan struct{} {
}
func runner(ctx context.Context, st storage.Storage, req *pb.AddPackageReq) {
modules, err := getGoModule(ctx, req.Url.Value)
modules, err := getGoModule(ctx, req.Url)
if err != nil {
logger.Error(ctx, err)
return

View File

@@ -3,12 +3,12 @@ package client_git
import (
"context"
"database/sql"
"embed"
"fmt"
pb "go.unistack.org/unistack-org/pkgdash/proto"
"go.unistack.org/unistack-org/pkgdash/storage"
"go.unistack.org/unistack-org/pkgdash/storage/postgres"
"go.unistack.org/unistack-org/pkgdash/storage/sqlite"
"google.golang.org/protobuf/types/known/wrapperspb"
"testing"
)
@@ -23,11 +23,8 @@ func TestClientPG(t *testing.T) {
t.Fatal(err)
}
st, err := postgres.NewStorage(conn)
if err != nil {
t.Fatal(err)
}
fucntion := postgres.NewStorage()
st := fucntion(conn, embed.FS{})
s, ok := st.(storage.Storage)
if !ok {
t.Fatal("typecast error")
@@ -40,8 +37,8 @@ func TestClientPG(t *testing.T) {
ch := cli.Run(ctx, s)
data := &pb.AddPackageReq{
Name: wrapperspb.String("test"),
Url: wrapperspb.String("https://github.com/dantedenis/service_history.git"),
Name: "test",
Url: "https://github.com/dantedenis/service_history.git",
}
ch <- data
@@ -59,11 +56,8 @@ func TestClientLite(t *testing.T) {
t.Fatal(err)
}
st, err := sqlite.NewStorage(conn)
if err != nil {
t.Fatal(err)
}
function := sqlite.NewStorage()
st := function(conn, embed.FS{})
s, ok := st.(storage.Storage)
if !ok {
t.Fatal("typecast error")
@@ -76,8 +70,8 @@ func TestClientLite(t *testing.T) {
ch := cli.Run(ctx, s)
data := &pb.AddPackageReq{
Name: wrapperspb.String("test"),
Url: wrapperspb.String("https://github.com/dantedenis/service_history.git"),
Name: "test",
Url: "https://github.com/dantedenis/service_history.git",
}
ch <- data