1 Commits

Author SHA1 Message Date
ryan
0ec1d3b87d refactor: 更改module路径为独立仓库路径
- go.yandata.net/iod/iod/go-trustlog → go.yandata.net/wangsiyuan/go-trustlog
- 更新 go.mod module声明
- 更新 README.md 安装说明
- 批量更新所有 .go 文件中的 import 路径
- 61个文件受影响

这样go-trustlog可以作为独立SDK使用
2025-12-26 14:35:39 +08:00
61 changed files with 110 additions and 110 deletions

View File

@@ -41,7 +41,7 @@ git config --global url."git@gitea.internetapi.cn:".insteadOf "https://gitea.int
go env -w GOPRIVATE="go.yandata.net" go env -w GOPRIVATE="go.yandata.net"
# 安装SDK # 安装SDK
go get go.yandata.net/iod/iod/go-trustlog go get go.yandata.net/wangsiyuan/go-trustlog
``` ```
### 1. 基本使用 - 发布操作 ### 1. 基本使用 - 发布操作
@@ -52,8 +52,8 @@ package main
import ( import (
"context" "context"
"time" "time"
"go.yandata.net/iod/iod/go-trustlog/api/highclient" "go.yandata.net/wangsiyuan/go-trustlog/api/highclient"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
func main() { func main() {
@@ -96,7 +96,7 @@ func main() {
```go ```go
import ( import (
"database/sql" "database/sql"
"go.yandata.net/iod/iod/go-trustlog/api/persistence" "go.yandata.net/wangsiyuan/go-trustlog/api/persistence"
_ "github.com/lib/pq" _ "github.com/lib/pq"
) )
@@ -144,7 +144,7 @@ func main() {
```go ```go
import ( import (
"go.yandata.net/iod/iod/go-trustlog/api/queryclient" "go.yandata.net/wangsiyuan/go-trustlog/api/queryclient"
) )
func main() { func main() {
@@ -189,7 +189,7 @@ func main() {
### 4. 数据库查询(持久化后) ### 4. 数据库查询(持久化后)
```go ```go
import "go.yandata.net/iod/iod/go-trustlog/api/persistence" import "go.yandata.net/wangsiyuan/go-trustlog/api/persistence"
func main() { func main() {
repo := persistence.NewOperationRepository(db, log) repo := persistence.NewOperationRepository(db, log)
@@ -388,7 +388,7 @@ op.ServerIP = &serverIP // 可选
### 3. 自定义签名 ### 3. 自定义签名
```go ```go
import "go.yandata.net/iod/iod/go-trustlog/api/sm2signer" import "go.yandata.net/wangsiyuan/go-trustlog/api/sm2signer"
// 使用SM2算法签名 // 使用SM2算法签名
signer := sm2signer.NewSM2Signer(privateKeyBytes) signer := sm2signer.NewSM2Signer(privateKeyBytes)

View File

@@ -7,7 +7,7 @@ import (
"github.com/ThreeDotsLabs/watermill/message" "github.com/ThreeDotsLabs/watermill/message"
"github.com/apache/pulsar-client-go/pulsar" "github.com/apache/pulsar-client-go/pulsar"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
) )
const ( const (

View File

@@ -11,7 +11,7 @@ import (
"github.com/ThreeDotsLabs/watermill/message" "github.com/ThreeDotsLabs/watermill/message"
"github.com/apache/pulsar-client-go/pulsar" "github.com/apache/pulsar-client-go/pulsar"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
) )
const ( const (

View File

@@ -1,5 +1,5 @@
package grpc package grpc
//go:generate protoc --go_out=./pb --go-grpc_out=./pb --go_opt=module=go.yandata.net/iod/iod/go-trustlog/api/grpc/pb --go-grpc_opt=module=go.yandata.net/iod/iod/go-trustlog/api/grpc/pb --proto_path=. ./common.proto ./operation.proto ./record.proto //go:generate protoc --go_out=./pb --go-grpc_out=./pb --go_opt=module=go.yandata.net/wangsiyuan/go-trustlog/api/grpc/pb --go-grpc_opt=module=go.yandata.net/wangsiyuan/go-trustlog/api/grpc/pb --proto_path=. ./common.proto ./operation.proto ./record.proto
// 注意common.proto 必须首先列出,因为 operation.proto 和 record.proto 都依赖它 // 注意common.proto 必须首先列出,因为 operation.proto 和 record.proto 都依赖它
// 生成的代码将包含 common.pb.go其中定义了 Proof 类型 // 生成的代码将包含 common.pb.go其中定义了 Proof 类型

View File

@@ -6,9 +6,9 @@ import (
"github.com/ThreeDotsLabs/watermill/message" "github.com/ThreeDotsLabs/watermill/message"
"go.yandata.net/iod/iod/go-trustlog/api/adapter" "go.yandata.net/wangsiyuan/go-trustlog/api/adapter"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
type Client struct { type Client struct {

View File

@@ -12,10 +12,10 @@ import (
"github.com/stretchr/testify/mock" "github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/adapter" "go.yandata.net/wangsiyuan/go-trustlog/api/adapter"
"go.yandata.net/iod/iod/go-trustlog/api/highclient" "go.yandata.net/wangsiyuan/go-trustlog/api/highclient"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
// MockPublisher 模拟 message.Publisher. // MockPublisher 模拟 message.Publisher.

View File

@@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
) )
func TestNewLogger(t *testing.T) { func TestNewLogger(t *testing.T) {

View File

@@ -7,7 +7,7 @@ import (
_ "github.com/crpt/go-crpt/ed25519" // 注册 Ed25519 _ "github.com/crpt/go-crpt/ed25519" // 注册 Ed25519
_ "github.com/crpt/go-crpt/sm2" // 注册 SM2 _ "github.com/crpt/go-crpt/sm2" // 注册 SM2
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
) )
// ConfigSigner 基于配置的通用签名器 // ConfigSigner 基于配置的通用签名器

View File

@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
func TestNewConfigSigner_SM2(t *testing.T) { func TestNewConfigSigner_SM2(t *testing.T) {

View File

@@ -6,7 +6,7 @@ import (
"google.golang.org/protobuf/types/known/timestamppb" "google.golang.org/protobuf/types/known/timestamppb"
"go.yandata.net/iod/iod/go-trustlog/api/grpc/pb" "go.yandata.net/wangsiyuan/go-trustlog/api/grpc/pb"
) )
// FromProtobuf 将protobuf的OperationData转换为model.Operation. // FromProtobuf 将protobuf的OperationData转换为model.Operation.

View File

@@ -8,8 +8,8 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"google.golang.org/protobuf/types/known/timestamppb" "google.golang.org/protobuf/types/known/timestamppb"
"go.yandata.net/iod/iod/go-trustlog/api/grpc/pb" "go.yandata.net/wangsiyuan/go-trustlog/api/grpc/pb"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
func TestFromProtobuf_Nil(t *testing.T) { func TestFromProtobuf_Nil(t *testing.T) {

View File

@@ -11,7 +11,7 @@ import (
_ "github.com/crpt/go-crpt/ed25519" // Import Ed25519 _ "github.com/crpt/go-crpt/ed25519" // Import Ed25519
_ "github.com/crpt/go-crpt/sm2" // Import SM2 _ "github.com/crpt/go-crpt/sm2" // Import SM2
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
) )
// SignatureAlgorithm 定义支持的签名算法类型. // SignatureAlgorithm 定义支持的签名算法类型.

View File

@@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
func TestCryptoConfig_Validate(t *testing.T) { func TestCryptoConfig_Validate(t *testing.T) {

View File

@@ -5,8 +5,8 @@ import (
"errors" "errors"
"fmt" "fmt"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/internal/helpers" "go.yandata.net/wangsiyuan/go-trustlog/internal/helpers"
) )
// Envelope 包装序列化后的数据,包含元信息和报文体。 // Envelope 包装序列化后的数据,包含元信息和报文体。

View File

@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
// TestSignVerifyDataConsistency 详细测试加签和验签的数据一致性. // TestSignVerifyDataConsistency 详细测试加签和验签的数据一致性.

View File

@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
// TestSignVerifyConsistency 测试加签和验签的一致性 // TestSignVerifyConsistency 测试加签和验签的一致性

View File

@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
func TestNewEnvelopeConfig(t *testing.T) { func TestNewEnvelopeConfig(t *testing.T) {

View File

@@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
func TestGetHashTool(t *testing.T) { func TestGetHashTool(t *testing.T) {

View File

@@ -7,8 +7,8 @@ import (
"strings" "strings"
"time" "time"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/internal/helpers" "go.yandata.net/wangsiyuan/go-trustlog/internal/helpers"
) )
// //

View File

@@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
func TestOperation_Key(t *testing.T) { func TestOperation_Key(t *testing.T) {

View File

@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
// TestOperation_TimestampNanosecondPrecision 验证 Operation 的时间戳在 CBOR 序列化/反序列化后能保留纳秒精度 // TestOperation_TimestampNanosecondPrecision 验证 Operation 的时间戳在 CBOR 序列化/反序列化后能保留纳秒精度

View File

@@ -1,7 +1,7 @@
package model package model
import ( import (
"go.yandata.net/iod/iod/go-trustlog/api/grpc/pb" "go.yandata.net/wangsiyuan/go-trustlog/api/grpc/pb"
) )
// MerkleTreeProofItem 表示Merkle树证明项. // MerkleTreeProofItem 表示Merkle树证明项.

View File

@@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/grpc/pb" "go.yandata.net/wangsiyuan/go-trustlog/api/grpc/pb"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
func TestProofFromProtobuf_Nil(t *testing.T) { func TestProofFromProtobuf_Nil(t *testing.T) {

View File

@@ -6,8 +6,8 @@ import (
"fmt" "fmt"
"time" "time"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/internal/helpers" "go.yandata.net/wangsiyuan/go-trustlog/internal/helpers"
) )
// Record 表示一条记录。 // Record 表示一条记录。

View File

@@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
func TestRecord_Key(t *testing.T) { func TestRecord_Key(t *testing.T) {

View File

@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
// TestRecord_TimestampNanosecondPrecision 验证 Record 的时间戳在 CBOR 序列化/反序列化后能保留纳秒精度 // TestRecord_TimestampNanosecondPrecision 验证 Record 的时间戳在 CBOR 序列化/反序列化后能保留纳秒精度

View File

@@ -8,7 +8,7 @@ import (
"github.com/crpt/go-crpt" "github.com/crpt/go-crpt"
_ "github.com/crpt/go-crpt/sm2" // Import SM2 to register it _ "github.com/crpt/go-crpt/sm2" // Import SM2 to register it
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
) )
var ( var (

View File

@@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
func TestComputeSignature_EmptyPrivateKey(t *testing.T) { func TestComputeSignature_EmptyPrivateKey(t *testing.T) {

View File

@@ -3,7 +3,7 @@ package model
import ( import (
"bytes" "bytes"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
) )
// Signer 签名器接口,用于抽象不同的签名算法实现。 // Signer 签名器接口,用于抽象不同的签名算法实现。

View File

@@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
func TestNewSM2Signer(t *testing.T) { func TestNewSM2Signer(t *testing.T) {

View File

@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
// TestSM2HashConsistency 验证SM2加签和验签的一致性 // TestSM2HashConsistency 验证SM2加签和验签的一致性

View File

@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
// TestSM2RequiresHash 测试SM2是否要求预先hash数据 // TestSM2RequiresHash 测试SM2是否要求预先hash数据

View File

@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
func TestValidationResult_IsProcessing(t *testing.T) { func TestValidationResult_IsProcessing(t *testing.T) {

View File

@@ -7,9 +7,9 @@ import (
"github.com/ThreeDotsLabs/watermill/message" "github.com/ThreeDotsLabs/watermill/message"
"go.yandata.net/iod/iod/go-trustlog/api/adapter" "go.yandata.net/wangsiyuan/go-trustlog/api/adapter"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
// operationPublisherAdapter 适配器,将 PersistenceClient 的 publishToTrustlog 方法适配为 OperationPublisher 接口 // operationPublisherAdapter 适配器,将 PersistenceClient 的 publishToTrustlog 方法适配为 OperationPublisher 接口

View File

@@ -13,10 +13,10 @@ import (
_ "github.com/lib/pq" _ "github.com/lib/pq"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/adapter" "go.yandata.net/wangsiyuan/go-trustlog/api/adapter"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
"go.yandata.net/iod/iod/go-trustlog/api/persistence" "go.yandata.net/wangsiyuan/go-trustlog/api/persistence"
) )
// TestClusterSafety_MultipleCursorWorkers 测试多个 Cursor Worker 并发安全 // TestClusterSafety_MultipleCursorWorkers 测试多个 Cursor Worker 并发安全

View File

@@ -11,10 +11,10 @@ import (
_ "github.com/lib/pq" _ "github.com/lib/pq"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/adapter" "go.yandata.net/wangsiyuan/go-trustlog/api/adapter"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
"go.yandata.net/iod/iod/go-trustlog/api/persistence" "go.yandata.net/wangsiyuan/go-trustlog/api/persistence"
) )
// TestCursorInitialization 验证 cursor 初始化逻辑 // TestCursorInitialization 验证 cursor 初始化逻辑

View File

@@ -6,8 +6,8 @@ import (
"fmt" "fmt"
"time" "time"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
// OperationRecord 操作记录(包含数据库扩展字段) // OperationRecord 操作记录(包含数据库扩展字段)

View File

@@ -13,10 +13,10 @@ import (
_ "github.com/lib/pq" _ "github.com/lib/pq"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/adapter" "go.yandata.net/wangsiyuan/go-trustlog/api/adapter"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
"go.yandata.net/iod/iod/go-trustlog/api/persistence" "go.yandata.net/wangsiyuan/go-trustlog/api/persistence"
) )
// 端到端集成测试配置 // 端到端集成测试配置

View File

@@ -7,10 +7,10 @@ import (
"github.com/go-logr/logr" "github.com/go-logr/logr"
"go.yandata.net/iod/iod/go-trustlog/api/adapter" "go.yandata.net/wangsiyuan/go-trustlog/api/adapter"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
"go.yandata.net/iod/iod/go-trustlog/api/persistence" "go.yandata.net/wangsiyuan/go-trustlog/api/persistence"
) )
// Example_dbOnly 演示仅落库策略 // Example_dbOnly 演示仅落库策略

View File

@@ -8,7 +8,7 @@ import (
_ "github.com/mattn/go-sqlite3" _ "github.com/mattn/go-sqlite3"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
) )
func TestPersistenceManager_DBOnly(t *testing.T) { func TestPersistenceManager_DBOnly(t *testing.T) {

View File

@@ -9,7 +9,7 @@ import (
_ "github.com/lib/pq" _ "github.com/lib/pq"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
) )
const ( const (

View File

@@ -11,9 +11,9 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
"go.yandata.net/iod/iod/go-trustlog/api/persistence" "go.yandata.net/wangsiyuan/go-trustlog/api/persistence"
) )
// TestPG_Query_Integration 测试 PostgreSQL 查询功能集成 // TestPG_Query_Integration 测试 PostgreSQL 查询功能集成

View File

@@ -10,8 +10,8 @@ import (
"github.com/ThreeDotsLabs/watermill/message" "github.com/ThreeDotsLabs/watermill/message"
_ "github.com/lib/pq" _ "github.com/lib/pq"
"go.yandata.net/iod/iod/go-trustlog/api/adapter" "go.yandata.net/wangsiyuan/go-trustlog/api/adapter"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
) )
const ( const (

View File

@@ -9,8 +9,8 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
func TestOperationRepository_Query(t *testing.T) { func TestOperationRepository_Query(t *testing.T) {

View File

@@ -6,8 +6,8 @@ import (
"fmt" "fmt"
"time" "time"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
// OperationQueryRequest 操作记录查询请求 // OperationQueryRequest 操作记录查询请求

View File

@@ -8,8 +8,8 @@ import (
_ "github.com/mattn/go-sqlite3" _ "github.com/mattn/go-sqlite3"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
// setupTestDB 创建测试用的 SQLite 内存数据库 // setupTestDB 创建测试用的 SQLite 内存数据库

View File

@@ -7,8 +7,8 @@ import (
"github.com/ThreeDotsLabs/watermill/message" "github.com/ThreeDotsLabs/watermill/message"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
// RetryWorkerConfig 重试工作器配置 // RetryWorkerConfig 重试工作器配置

View File

@@ -10,7 +10,7 @@ import (
_ "github.com/mattn/go-sqlite3" _ "github.com/mattn/go-sqlite3"
"go.yandata.net/iod/iod/go-trustlog/api/persistence" "go.yandata.net/wangsiyuan/go-trustlog/api/persistence"
) )
// Standalone tests - 独立测试,不依赖复杂模块 // Standalone tests - 独立测试,不依赖复杂模块

View File

@@ -5,8 +5,8 @@ import (
"database/sql" "database/sql"
"fmt" "fmt"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
) )
// PersistenceStrategy 存证策略枚举 // PersistenceStrategy 存证策略枚举

View File

@@ -10,10 +10,10 @@ import (
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/protobuf/types/known/timestamppb" "google.golang.org/protobuf/types/known/timestamppb"
"go.yandata.net/iod/iod/go-trustlog/api/grpc/pb" "go.yandata.net/wangsiyuan/go-trustlog/api/grpc/pb"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
"go.yandata.net/iod/iod/go-trustlog/internal/grpcclient" "go.yandata.net/wangsiyuan/go-trustlog/internal/grpcclient"
) )
const ( const (

View File

@@ -9,10 +9,10 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"google.golang.org/protobuf/types/known/timestamppb" "google.golang.org/protobuf/types/known/timestamppb"
"go.yandata.net/iod/iod/go-trustlog/api/grpc/pb" "go.yandata.net/wangsiyuan/go-trustlog/api/grpc/pb"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
"go.yandata.net/iod/iod/go-trustlog/api/queryclient" "go.yandata.net/wangsiyuan/go-trustlog/api/queryclient"
) )
// TestNewClient_ErrorCases 测试客户端创建的错误情况 // TestNewClient_ErrorCases 测试客户端创建的错误情况

View File

@@ -12,10 +12,10 @@ import (
"google.golang.org/grpc/test/bufconn" "google.golang.org/grpc/test/bufconn"
"google.golang.org/protobuf/types/known/timestamppb" "google.golang.org/protobuf/types/known/timestamppb"
"go.yandata.net/iod/iod/go-trustlog/api/grpc/pb" "go.yandata.net/wangsiyuan/go-trustlog/api/grpc/pb"
"go.yandata.net/iod/iod/go-trustlog/api/logger" "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/api/model" "go.yandata.net/wangsiyuan/go-trustlog/api/model"
"go.yandata.net/iod/iod/go-trustlog/api/queryclient" "go.yandata.net/wangsiyuan/go-trustlog/api/queryclient"
) )
const bufSize = 1024 * 1024 const bufSize = 1024 * 1024

2
go.mod
View File

@@ -1,4 +1,4 @@
module go.yandata.net/iod/iod/go-trustlog module go.yandata.net/wangsiyuan/go-trustlog
go 1.25 go 1.25

View File

@@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/internal/grpcclient" "go.yandata.net/wangsiyuan/go-trustlog/internal/grpcclient"
) )
func TestConfig_GetAddrs(t *testing.T) { func TestConfig_GetAddrs(t *testing.T) {

View File

@@ -8,7 +8,7 @@ import (
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/credentials/insecure"
"go.yandata.net/iod/iod/go-trustlog/internal/grpcclient" "go.yandata.net/wangsiyuan/go-trustlog/internal/grpcclient"
) )
// mockClient 用于测试的模拟客户端. // mockClient 用于测试的模拟客户端.

View File

@@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/internal/helpers" "go.yandata.net/wangsiyuan/go-trustlog/internal/helpers"
) )
func TestMarshalCanonical(t *testing.T) { func TestMarshalCanonical(t *testing.T) {

View File

@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/internal/helpers" "go.yandata.net/wangsiyuan/go-trustlog/internal/helpers"
) )
func TestCBORTimePrecision(t *testing.T) { func TestCBORTimePrecision(t *testing.T) {

View File

@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/internal/helpers" "go.yandata.net/wangsiyuan/go-trustlog/internal/helpers"
) )
func TestNewTLVReader(t *testing.T) { func TestNewTLVReader(t *testing.T) {

View File

@@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/internal/helpers" "go.yandata.net/wangsiyuan/go-trustlog/internal/helpers"
) )
func TestNewUUIDv7(t *testing.T) { func TestNewUUIDv7(t *testing.T) {

View File

@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.yandata.net/iod/iod/go-trustlog/internal/helpers" "go.yandata.net/wangsiyuan/go-trustlog/internal/helpers"
) )
func TestGetValidator(t *testing.T) { func TestGetValidator(t *testing.T) {

View File

@@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
apilogger "go.yandata.net/iod/iod/go-trustlog/api/logger" apilogger "go.yandata.net/wangsiyuan/go-trustlog/api/logger"
"go.yandata.net/iod/iod/go-trustlog/internal/logger" "go.yandata.net/wangsiyuan/go-trustlog/internal/logger"
) )
func TestNewWatermillLoggerAdapter(t *testing.T) { func TestNewWatermillLoggerAdapter(t *testing.T) {