Skip to content

Commit

Permalink
taldir: init at 21-07-2022
Browse files Browse the repository at this point in the history
  • Loading branch information
matusf committed Jan 3, 2024
1 parent a9b16ad commit 32487c1
Show file tree
Hide file tree
Showing 2 changed files with 149 additions and 0 deletions.
46 changes: 46 additions & 0 deletions pkgs/by-name/taldir/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
fetchgit,
lib,
stdenv,
recutils,
buildGoModule,
}: let
version = "21-07-2022-unreleased";
in
buildGoModule rec {
inherit version;
pname = "taldir";

src = fetchgit {
url = "https://git.taler.net/taldir.git";
rev = "961875a79149e303af87b1bbb0f1fc717f275dfd";
hash = "sha256-IMNEPo/a4pAWF5LwuAvVfM0RdEl2ztsfVGODoHNzB9E=";
leaveDotGit = true;
};

preBuild = ''
mkdir -p internal/gana
pushd third_party/gana/gnu-taler-error-codes
make taler_error_codes.go
popd
cp third_party/gana/gnu-taler-error-codes/taler_error_codes.go internal/gana/
'';

vendorHash = "sha256-SrlFw30S5GAk/7OaCvQfHfppYWKB/7O7jH2z2GURcWw=";

buildFlags = ["-mod=mod"];

nativeBuildInputs = [
recutils
];

patches = [./taler-go-import.patch];

meta = {
homepage = "https://git.taler.net/taldir.git";
description = "Directory service to resolve wallet mailboxes by messenger addresses.";
license = lib.licenses.agpl3Plus;
};
}
103 changes: 103 additions & 0 deletions pkgs/by-name/taldir/taler-go-import.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
diff --git a/cmd/taldir-cli/main.go b/cmd/taldir-cli/main.go
index 8d62544..047f358 100644
--- a/cmd/taldir-cli/main.go
+++ b/cmd/taldir-cli/main.go
@@ -25,8 +25,9 @@ import (
"os"

gnunetutil "gnunet/util"
- "taler.net/taldir/internal/util"
- taldir "taler.net/taldir/pkg/rest"
+
+ "git.taler.net/taldir/internal/util"
+ taldir "git.taler.net/taldir/pkg/rest"
)

// Generates a link from a challenge and address
diff --git a/cmd/taldir-server/main.go b/cmd/taldir-server/main.go
index 9d1a1f6..67dc730 100644
--- a/cmd/taldir-server/main.go
+++ b/cmd/taldir-server/main.go
@@ -31,7 +31,7 @@ import (
"log"
"net/http"

- taldir "taler.net/taldir/pkg/rest"
+ taldir "git.taler.net/taldir/pkg/rest"
)

var t taldir.Taldir
diff --git a/cmd/taldir-server/main_test.go b/cmd/taldir-server/main_test.go
index 3000e31..713e62e 100644
--- a/cmd/taldir-server/main_test.go
+++ b/cmd/taldir-server/main_test.go
@@ -30,10 +30,10 @@ import (

gnunetutil "gnunet/util"

+ _ "git.taler.net/taldir/cmd/taldir-server"
+ "git.taler.net/taldir/internal/util"
+ taldir "git.taler.net/taldir/pkg/rest"
"github.com/jarcoal/httpmock"
- _ "taler.net/taldir/cmd/taldir-server"
- "taler.net/taldir/internal/util"
- taldir "taler.net/taldir/pkg/rest"
)

var t taldir.Taldir
diff --git a/go.mod b/go.mod
index 4fec163..f39f561 100644
--- a/go.mod
+++ b/go.mod
@@ -1,4 +1,4 @@
-module taler.net/taldir
+module git.taler.net/taldir

go 1.18

@@ -30,3 +30,5 @@ require (
)

replace gnunet v0.1.27 => ./third_party/gnunet-go/src/gnunet
+
+replace taler.net/taler-go.git => git.taler.net/taler-go.git v0.0.0-20220719135513-36eb87bf37a3
diff --git a/internal/util/helper.go b/internal/util/helper.go
index 239980f..ba37921 100644
--- a/internal/util/helper.go
+++ b/internal/util/helper.go
@@ -23,8 +23,9 @@ import (
"fmt"
gnunetutil "gnunet/util"
"math/rand"
- talerutil "taler.net/taler-go.git/pkg/util"
"time"
+
+ talerutil "git.taler.net/taler-go.git/pkg/util"
)

// Generates a solution from a challenge and pubkey
diff --git a/pkg/rest/taldir.go b/pkg/rest/taldir.go
index 5e50edf..169b396 100644
--- a/pkg/rest/taldir.go
+++ b/pkg/rest/taldir.go
@@ -38,16 +38,16 @@ import (

gnunetutil "gnunet/util"

+ "git.taler.net/taldir/internal/gana"
+ "git.taler.net/taldir/internal/util"
+ "git.taler.net/taler-go.git/pkg/merchant"
+ tos "git.taler.net/taler-go.git/pkg/rest"
"github.com/gorilla/mux"
"github.com/skip2/go-qrcode"
"gopkg.in/ini.v1"
"gorm.io/driver/postgres"
"gorm.io/gorm"
"gorm.io/gorm/logger"
- "taler.net/taldir/internal/gana"
- "taler.net/taldir/internal/util"
- "taler.net/taler-go.git/pkg/merchant"
- tos "taler.net/taler-go.git/pkg/rest"
)

// Taldir is the primary object of the Taldir service

0 comments on commit 32487c1

Please sign in to comment.