refactor(module): simplify module name to Wavelet and standardize import paths

- Declared module Wavelet in backend/go.mod
- Replaced github.com/Rain-kl/Wavelet/ with clean Wavelet/ import paths across backend codebase
- Updated architecture guards, Makefile, swagger, and build tests
- 100% passed all tests, lint checks, and binary compilation
This commit is contained in:
ryan
2026-08-28 13:10:30 +08:00
parent f2ab94501c
commit 9f8890d159
201 changed files with 539 additions and 620 deletions
+1 -2
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -8,7 +7,7 @@ package cmd
import (
"log"
"github.com/Rain-kl/Wavelet/core"
"Wavelet/core"
"github.com/spf13/cobra"
)
+1 -2
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -7,7 +6,7 @@ package cmd
import (
"log"
"github.com/Rain-kl/Wavelet/core"
"Wavelet/core"
"github.com/spf13/cobra"
)
+18 -18
View File
@@ -10,24 +10,24 @@ import (
"log"
"time"
"github.com/Rain-kl/Wavelet/core"
"github.com/Rain-kl/Wavelet/core/contracts"
"github.com/Rain-kl/Wavelet/pkg/config"
"github.com/Rain-kl/Wavelet/plugins/domain/admin"
"github.com/Rain-kl/Wavelet/plugins/domain/auth"
"github.com/Rain-kl/Wavelet/plugins/domain/cap"
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway"
"github.com/Rain-kl/Wavelet/plugins/domain/risk_control"
"github.com/Rain-kl/Wavelet/plugins/domain/system"
"github.com/Rain-kl/Wavelet/plugins/domain/upload"
"github.com/Rain-kl/Wavelet/plugins/domain/user"
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_asynq_cron"
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_asynq_worker"
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_http"
"github.com/Rain-kl/Wavelet/plugins/infra/cache"
infradb "github.com/Rain-kl/Wavelet/plugins/infra/database"
"github.com/Rain-kl/Wavelet/plugins/infra/logger"
"github.com/Rain-kl/Wavelet/plugins/infra/storage"
"Wavelet/core"
"Wavelet/core/contracts"
"Wavelet/pkg/config"
"Wavelet/plugins/domain/admin"
"Wavelet/plugins/domain/auth"
"Wavelet/plugins/domain/cap"
"Wavelet/plugins/domain/message_gateway"
"Wavelet/plugins/domain/risk_control"
"Wavelet/plugins/domain/system"
"Wavelet/plugins/domain/upload"
"Wavelet/plugins/domain/user"
"Wavelet/plugins/drivers/driver_asynq_cron"
"Wavelet/plugins/drivers/driver_asynq_worker"
"Wavelet/plugins/drivers/driver_http"
"Wavelet/plugins/infra/cache"
infradb "Wavelet/plugins/infra/database"
"Wavelet/plugins/infra/logger"
"Wavelet/plugins/infra/storage"
"github.com/pressly/goose/v3"
goosedb "github.com/pressly/goose/v3/database"
)
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/Rain-kl/Wavelet/core"
"Wavelet/core"
)
func TestNewWaveletAppProfiles(t *testing.T) {
+2 -2
View File
@@ -12,8 +12,8 @@ import (
"runtime"
"strings"
"github.com/Rain-kl/Wavelet/pkg/buildinfo"
"github.com/Rain-kl/Wavelet/pkg/config"
"Wavelet/pkg/buildinfo"
"Wavelet/pkg/config"
)
//nolint:unused // startup banner formatting utilities
+2 -2
View File
@@ -7,8 +7,8 @@ import (
"strings"
"testing"
"github.com/Rain-kl/Wavelet/pkg/buildinfo"
"github.com/Rain-kl/Wavelet/pkg/config"
"Wavelet/pkg/buildinfo"
"Wavelet/pkg/config"
)
func TestFormatStartupBanner(t *testing.T) {
+3 -3
View File
@@ -13,10 +13,10 @@ import (
"os"
"strings"
userdomain "github.com/Rain-kl/Wavelet/plugins/domain/user"
"github.com/Rain-kl/Wavelet/plugins/infra/database"
userdomain "Wavelet/plugins/domain/user"
"Wavelet/plugins/infra/database"
"github.com/Rain-kl/Wavelet/plugins/domain/auth"
"Wavelet/plugins/domain/auth"
"github.com/spf13/cobra"
"gorm.io/gorm"
)
+2 -2
View File
@@ -10,8 +10,8 @@ import (
"testing"
"time"
"github.com/Rain-kl/Wavelet/pkg/testhelper"
userdomain "github.com/Rain-kl/Wavelet/plugins/domain/user"
"Wavelet/pkg/testhelper"
userdomain "Wavelet/plugins/domain/user"
)
func TestResetPasswdCmd_WithUserAndPassword(t *testing.T) {
+4 -5
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -9,10 +8,10 @@ import (
"log"
"time"
"github.com/Rain-kl/Wavelet/pkg/buildinfo"
"github.com/Rain-kl/Wavelet/pkg/config"
"github.com/Rain-kl/Wavelet/pkg/logger"
"github.com/Rain-kl/Wavelet/pkg/trace"
"Wavelet/pkg/buildinfo"
"Wavelet/pkg/config"
"Wavelet/pkg/logger"
"Wavelet/pkg/trace"
"github.com/spf13/cobra"
)
+1 -2
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -7,7 +6,7 @@ package cmd
import (
"log"
"github.com/Rain-kl/Wavelet/core"
"Wavelet/core"
"github.com/spf13/cobra"
)
+1 -2
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -7,7 +6,7 @@ package cmd
import (
"log"
"github.com/Rain-kl/Wavelet/core"
"Wavelet/core"
"github.com/spf13/cobra"
)
+2 -2
View File
@@ -14,8 +14,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/Rain-kl/Wavelet/core"
"github.com/Rain-kl/Wavelet/core/extpoints"
"Wavelet/core"
"Wavelet/core/extpoints"
)
// appMockDriver is a test driver tracking its start/stop lifecycle.
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"sync"
"time"
"github.com/Rain-kl/Wavelet/core/extpoints"
"Wavelet/core/extpoints"
)
// Context is the central micro-kernel service bus and runtime lifecycle container.
+1 -1
View File
@@ -15,7 +15,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/Rain-kl/Wavelet/core"
"Wavelet/core"
)
// Sample services for testing
+1 -1
View File
@@ -14,7 +14,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/Rain-kl/Wavelet/core"
"Wavelet/core"
)
type UserRegisteredEvent struct {
+2 -2
View File
@@ -12,8 +12,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/Rain-kl/Wavelet/core"
"github.com/Rain-kl/Wavelet/core/extpoints"
"Wavelet/core"
"Wavelet/core/extpoints"
)
func TestRouterExtension(t *testing.T) {
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"context"
"errors"
"github.com/Rain-kl/Wavelet/core/extpoints"
"Wavelet/core/extpoints"
)
// Standard sentinel errors returned by core operations.
@@ -8,8 +8,8 @@ package custom_example
import (
"net/http"
"github.com/Rain-kl/Wavelet/core"
"github.com/Rain-kl/Wavelet/core/contracts"
"Wavelet/core"
"Wavelet/core/contracts"
"github.com/gin-gonic/gin"
)
+1 -1
View File
@@ -1,4 +1,4 @@
module github.com/Rain-kl/Wavelet
module Wavelet
go 1.25.7
+1 -1
View File
@@ -4,7 +4,7 @@
// Package main 是 Wavelet 平台的程序入口
package main
import "github.com/Rain-kl/Wavelet/cmd"
import "Wavelet/cmd"
// @title Wavelet API
// @version 1.0.0
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
+1 -2
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -9,7 +8,7 @@ import (
"fmt"
"log"
"github.com/Rain-kl/Wavelet/pkg/config"
"Wavelet/pkg/config"
"github.com/bwmarrin/snowflake"
)
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
+1 -1
View File
@@ -4,7 +4,7 @@
package testhelper
import (
"github.com/Rain-kl/Wavelet/pkg/response"
"Wavelet/pkg/response"
"github.com/gin-gonic/gin"
)
+2 -3
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -10,8 +9,8 @@ import (
"testing"
"time"
cachepkg "github.com/Rain-kl/Wavelet/plugins/infra/cache"
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
cachepkg "Wavelet/plugins/infra/cache"
db "Wavelet/plugins/infra/database"
"github.com/alicebob/miniredis/v2"
"github.com/glebarez/sqlite"
"github.com/redis/go-redis/v9"
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
+1 -2
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -12,7 +11,7 @@ import (
"net/url"
"time"
"github.com/Rain-kl/Wavelet/pkg/httppool"
"Wavelet/pkg/httppool"
)
// IsLocalhost 检查 URL 是否为 localhost
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -7,9 +7,9 @@ import (
"net/http"
"strconv"
"github.com/Rain-kl/Wavelet/pkg/response"
"github.com/Rain-kl/Wavelet/plugins/domain/auth"
"github.com/Rain-kl/Wavelet/plugins/infra/database"
"Wavelet/pkg/response"
"Wavelet/plugins/domain/auth"
"Wavelet/plugins/infra/database"
"github.com/gin-gonic/gin"
)
@@ -10,8 +10,8 @@ import (
"github.com/gin-gonic/gin"
"github.com/Rain-kl/Wavelet/pkg/response"
"github.com/Rain-kl/Wavelet/plugins/infra/storage/diskcache"
"Wavelet/pkg/response"
"Wavelet/plugins/infra/storage/diskcache"
)
type updateCacheConfigRequest struct {
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -13,13 +12,13 @@ import (
"strings"
"time"
"github.com/Rain-kl/Wavelet/pkg/logger"
mail "github.com/Rain-kl/Wavelet/pkg/mail"
"github.com/Rain-kl/Wavelet/pkg/response"
"github.com/Rain-kl/Wavelet/plugins/domain/cap"
cachepkg "github.com/Rain-kl/Wavelet/plugins/infra/cache"
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
"github.com/Rain-kl/Wavelet/plugins/infra/storage/objectstore"
"Wavelet/pkg/logger"
mail "Wavelet/pkg/mail"
"Wavelet/pkg/response"
"Wavelet/plugins/domain/cap"
cachepkg "Wavelet/plugins/infra/cache"
db "Wavelet/plugins/infra/database"
"Wavelet/plugins/infra/storage/objectstore"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
)
+3 -4
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -19,9 +18,9 @@ import (
"github.com/gin-gonic/gin"
"gorm.io/gorm"
"github.com/Rain-kl/Wavelet/pkg/config"
"github.com/Rain-kl/Wavelet/pkg/response"
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
"Wavelet/pkg/config"
"Wavelet/pkg/response"
db "Wavelet/plugins/infra/database"
)
const (
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -15,14 +14,14 @@ import (
"strings"
"time"
"github.com/Rain-kl/Wavelet/pkg/config"
"github.com/Rain-kl/Wavelet/pkg/logger"
"github.com/Rain-kl/Wavelet/pkg/response"
"github.com/Rain-kl/Wavelet/pkg/util"
"github.com/Rain-kl/Wavelet/plugins/domain/risk_control"
"github.com/Rain-kl/Wavelet/plugins/domain/risk_control/logstore"
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_asynq_worker"
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
"Wavelet/pkg/config"
"Wavelet/pkg/logger"
"Wavelet/pkg/response"
"Wavelet/pkg/util"
"Wavelet/plugins/domain/risk_control"
"Wavelet/plugins/domain/risk_control/logstore"
"Wavelet/plugins/drivers/driver_asynq_worker"
db "Wavelet/plugins/infra/database"
"github.com/gin-gonic/gin"
"github.com/gorilla/websocket"
)
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -16,10 +15,10 @@ import (
"github.com/gin-gonic/gin"
"gorm.io/gorm"
"github.com/Rain-kl/Wavelet/pkg/config"
"github.com/Rain-kl/Wavelet/pkg/logger"
"github.com/Rain-kl/Wavelet/pkg/response"
"github.com/Rain-kl/Wavelet/plugins/domain/risk_control/logstore"
"Wavelet/pkg/config"
"Wavelet/pkg/logger"
"Wavelet/pkg/response"
"Wavelet/plugins/domain/risk_control/logstore"
)
var startTime = time.Now()
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -14,10 +13,10 @@ import (
"github.com/gin-gonic/gin"
"github.com/robfig/cron/v3"
"github.com/Rain-kl/Wavelet/pkg/logger"
"github.com/Rain-kl/Wavelet/pkg/response"
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_asynq_cron"
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_asynq_worker"
"Wavelet/pkg/logger"
"Wavelet/pkg/response"
"Wavelet/plugins/drivers/driver_asynq_cron"
"Wavelet/plugins/drivers/driver_asynq_worker"
)
// ListTaskTypes 获取支持的任务类型列表
@@ -11,7 +11,7 @@ import (
"github.com/gin-gonic/gin"
"gorm.io/gorm"
"github.com/Rain-kl/Wavelet/pkg/response"
"Wavelet/pkg/response"
)
// CreateTemplateRequest 创建模板请求
@@ -24,10 +24,10 @@ import (
"github.com/gin-gonic/gin"
"golang.org/x/mod/semver"
"github.com/Rain-kl/Wavelet/pkg/buildinfo"
"github.com/Rain-kl/Wavelet/pkg/logger"
"github.com/Rain-kl/Wavelet/pkg/response"
"github.com/Rain-kl/Wavelet/pkg/util"
"Wavelet/pkg/buildinfo"
"Wavelet/pkg/logger"
"Wavelet/pkg/response"
"Wavelet/pkg/util"
)
const (
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -15,13 +14,13 @@ import (
"github.com/gin-gonic/gin"
"gorm.io/gorm"
"github.com/Rain-kl/Wavelet/core/contracts"
"github.com/Rain-kl/Wavelet/pkg/idgen"
"github.com/Rain-kl/Wavelet/pkg/logger"
"github.com/Rain-kl/Wavelet/pkg/response"
"github.com/Rain-kl/Wavelet/pkg/util"
"github.com/Rain-kl/Wavelet/plugins/domain/auth"
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
"Wavelet/core/contracts"
"Wavelet/pkg/idgen"
"Wavelet/pkg/logger"
"Wavelet/pkg/response"
"Wavelet/pkg/util"
"Wavelet/plugins/domain/auth"
db "Wavelet/plugins/infra/database"
)
const minPasswordLength = 8
+5 -5
View File
@@ -4,11 +4,11 @@
package admin
import (
"github.com/Rain-kl/Wavelet/core/contracts"
"github.com/Rain-kl/Wavelet/pkg/logger"
"github.com/Rain-kl/Wavelet/pkg/response"
"github.com/Rain-kl/Wavelet/pkg/trace"
"github.com/Rain-kl/Wavelet/pkg/util"
"Wavelet/core/contracts"
"Wavelet/pkg/logger"
"Wavelet/pkg/response"
"Wavelet/pkg/trace"
"Wavelet/pkg/util"
"github.com/gin-gonic/gin"
)
+3 -3
View File
@@ -8,9 +8,9 @@ import (
"context"
"embed"
"github.com/Rain-kl/Wavelet/core"
"github.com/Rain-kl/Wavelet/core/contracts"
"github.com/Rain-kl/Wavelet/core/extpoints"
"Wavelet/core"
"Wavelet/core/contracts"
"Wavelet/core/extpoints"
"github.com/gin-gonic/gin"
"github.com/hibiken/asynq"
)
+2 -2
View File
@@ -10,8 +10,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/Rain-kl/Wavelet/core"
"github.com/Rain-kl/Wavelet/plugins/domain/admin"
"Wavelet/core"
"Wavelet/plugins/domain/admin"
)
func TestAdminPluginUnit(t *testing.T) {
+5 -5
View File
@@ -16,11 +16,11 @@ import (
"github.com/shopspring/decimal"
"gorm.io/gorm"
"github.com/Rain-kl/Wavelet/pkg/cache/ram"
"github.com/Rain-kl/Wavelet/pkg/idgen"
"github.com/Rain-kl/Wavelet/pkg/util"
cachepkg "github.com/Rain-kl/Wavelet/plugins/infra/cache"
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
"Wavelet/pkg/cache/ram"
"Wavelet/pkg/idgen"
"Wavelet/pkg/util"
cachepkg "Wavelet/plugins/infra/cache"
db "Wavelet/plugins/infra/database"
)
const (
+1 -1
View File
@@ -12,7 +12,7 @@ import (
"path/filepath"
"syscall"
"github.com/Rain-kl/Wavelet/pkg/logger"
"Wavelet/pkg/logger"
)
const installedBinaryMode = 0o755
@@ -12,9 +12,9 @@ import (
"gorm.io/gorm"
"github.com/Rain-kl/Wavelet/pkg/cache/ram"
"github.com/Rain-kl/Wavelet/pkg/util"
cachepkg "github.com/Rain-kl/Wavelet/plugins/infra/cache"
"Wavelet/pkg/cache/ram"
"Wavelet/pkg/util"
cachepkg "Wavelet/plugins/infra/cache"
)
const (
@@ -14,8 +14,8 @@ import (
"github.com/redis/go-redis/v9/maintnotifications"
"gorm.io/gorm"
"github.com/Rain-kl/Wavelet/plugins/infra/cache"
"github.com/Rain-kl/Wavelet/plugins/infra/database"
"Wavelet/plugins/infra/cache"
"Wavelet/plugins/infra/database"
)
func setupSystemConfigTest(t *testing.T) (*gorm.DB, func()) {
+2 -3
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -8,8 +7,8 @@ import (
"context"
"encoding/json"
"github.com/Rain-kl/Wavelet/core/contracts"
"github.com/Rain-kl/Wavelet/pkg/logger"
"Wavelet/core/contracts"
"Wavelet/pkg/logger"
"github.com/gin-gonic/gin"
)
@@ -10,8 +10,8 @@ import (
"strconv"
"strings"
"github.com/Rain-kl/Wavelet/core/contracts"
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
"Wavelet/core/contracts"
db "Wavelet/plugins/infra/database"
"github.com/coreos/go-oidc/v3/oidc"
"golang.org/x/oauth2"
+4 -4
View File
@@ -10,10 +10,10 @@ import (
"sync"
"time"
"github.com/Rain-kl/Wavelet/core/contracts"
"github.com/Rain-kl/Wavelet/pkg/cache/ram"
"github.com/Rain-kl/Wavelet/pkg/util"
db "github.com/Rain-kl/Wavelet/plugins/infra/cache"
"Wavelet/core/contracts"
"Wavelet/pkg/cache/ram"
"Wavelet/pkg/util"
db "Wavelet/plugins/infra/cache"
)
const (
+3 -3
View File
@@ -11,9 +11,9 @@ import (
"github.com/redis/go-redis/v9"
"github.com/redis/go-redis/v9/maintnotifications"
"github.com/Rain-kl/Wavelet/core/contracts"
"github.com/Rain-kl/Wavelet/plugins/domain/auth"
db "github.com/Rain-kl/Wavelet/plugins/infra/cache"
"Wavelet/core/contracts"
"Wavelet/plugins/domain/auth"
db "Wavelet/plugins/infra/cache"
)
func setupOauthCacheTest(t *testing.T) (*miniredis.Miniredis, func()) {
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
-1
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
+7 -8
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -13,14 +12,14 @@ import (
"strings"
"time"
"github.com/Rain-kl/Wavelet/core/contracts"
"Wavelet/core/contracts"
"github.com/Rain-kl/Wavelet/pkg/idgen"
"github.com/Rain-kl/Wavelet/pkg/logger"
"github.com/Rain-kl/Wavelet/pkg/response"
"github.com/Rain-kl/Wavelet/pkg/util"
cachepkg "github.com/Rain-kl/Wavelet/plugins/infra/cache"
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
"Wavelet/pkg/idgen"
"Wavelet/pkg/logger"
"Wavelet/pkg/response"
"Wavelet/pkg/util"
cachepkg "Wavelet/plugins/infra/cache"
db "Wavelet/plugins/infra/database"
"github.com/coreos/go-oidc/v3/oidc"
"github.com/gin-contrib/sessions"
"github.com/gin-gonic/gin"
+5 -6
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -10,11 +9,11 @@ import (
"encoding/hex"
"errors"
"github.com/Rain-kl/Wavelet/core/contracts"
"github.com/Rain-kl/Wavelet/pkg/response"
"github.com/Rain-kl/Wavelet/pkg/trace"
"github.com/Rain-kl/Wavelet/pkg/util"
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
"Wavelet/core/contracts"
"Wavelet/pkg/response"
"Wavelet/pkg/trace"
"Wavelet/pkg/util"
db "Wavelet/plugins/infra/database"
"github.com/gin-gonic/gin"
)
+1 -2
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -12,7 +11,7 @@ import (
"strings"
"time"
"github.com/Rain-kl/Wavelet/core/contracts"
"Wavelet/core/contracts"
)
var authSourceNamePattern = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9_-]{0,79}$`)
+3 -3
View File
@@ -7,9 +7,9 @@ package auth
import (
"embed"
"github.com/Rain-kl/Wavelet/core"
"github.com/Rain-kl/Wavelet/core/contracts"
"github.com/Rain-kl/Wavelet/core/extpoints"
"Wavelet/core"
"Wavelet/core/contracts"
"Wavelet/core/extpoints"
)
//go:embed migrations/*.sql
+4 -4
View File
@@ -16,10 +16,10 @@ import (
"github.com/stretchr/testify/require"
"gorm.io/gorm"
"github.com/Rain-kl/Wavelet/core"
"github.com/Rain-kl/Wavelet/core/contracts"
"github.com/Rain-kl/Wavelet/plugins/domain/auth"
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
"Wavelet/core"
"Wavelet/core/contracts"
"Wavelet/plugins/domain/auth"
db "Wavelet/plugins/infra/database"
)
type testUser struct {
+1 -2
View File
@@ -1,4 +1,3 @@
// Copyright 2025 linux.do
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
@@ -7,7 +6,7 @@ package auth
import (
"context"
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
db "Wavelet/plugins/infra/database"
)
// GetAuthSourceByID 根据 ID 获取认证源
+3 -3
View File
@@ -8,9 +8,9 @@ import (
"errors"
"sync"
"github.com/Rain-kl/Wavelet/core/contracts"
"github.com/Rain-kl/Wavelet/pkg/util"
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
"Wavelet/core/contracts"
"Wavelet/pkg/util"
db "Wavelet/plugins/infra/database"
"github.com/gin-gonic/gin"
)
+3 -3
View File
@@ -11,9 +11,9 @@ import (
"strconv"
"strings"
"github.com/Rain-kl/Wavelet/core/contracts"
"github.com/Rain-kl/Wavelet/pkg/config"
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
"Wavelet/core/contracts"
"Wavelet/pkg/config"
db "Wavelet/plugins/infra/database"
"github.com/gin-contrib/sessions"
"github.com/gin-gonic/gin"
"github.com/google/uuid"
+3 -3
View File
@@ -6,9 +6,9 @@ package cap
import (
"net/http"
"github.com/Rain-kl/Wavelet/pkg/logger"
"github.com/Rain-kl/Wavelet/pkg/response"
"github.com/Rain-kl/Wavelet/plugins/domain/cap/pow"
"Wavelet/pkg/logger"
"Wavelet/pkg/response"
"Wavelet/plugins/domain/cap/pow"
"github.com/gin-gonic/gin"
)
+3 -3
View File
@@ -13,9 +13,9 @@ import (
"sync"
"time"
"github.com/Rain-kl/Wavelet/pkg/config"
"github.com/Rain-kl/Wavelet/plugins/domain/cap/pow"
db "github.com/Rain-kl/Wavelet/plugins/infra/cache"
"Wavelet/pkg/config"
"Wavelet/plugins/domain/cap/pow"
db "Wavelet/plugins/infra/cache"
)
const (
+1 -1
View File
@@ -6,7 +6,7 @@ package cap
import (
"github.com/gin-gonic/gin"
"github.com/Rain-kl/Wavelet/pkg/response"
"Wavelet/pkg/response"
)
// VerifyMiddleware returns a Gin middleware that checks and consumes the X-Cap-Token header.
+2 -2
View File
@@ -5,8 +5,8 @@
package cap
import (
"github.com/Rain-kl/Wavelet/core"
"github.com/Rain-kl/Wavelet/core/extpoints"
"Wavelet/core"
"Wavelet/core/extpoints"
)
// Plugin implements core.Plugin to provide CAPTCHA generation, validation, and route protection.
@@ -14,9 +14,9 @@ import (
"golang.org/x/sync/singleflight"
"github.com/Rain-kl/Wavelet/pkg/util"
cachepkg "github.com/Rain-kl/Wavelet/plugins/infra/cache"
database "github.com/Rain-kl/Wavelet/plugins/infra/database"
"Wavelet/pkg/util"
cachepkg "Wavelet/plugins/infra/cache"
database "Wavelet/plugins/infra/database"
)
const (
+11 -11
View File
@@ -16,17 +16,17 @@ import (
"github.com/stretchr/testify/require"
"gorm.io/gorm"
"github.com/Rain-kl/Wavelet/core"
"github.com/Rain-kl/Wavelet/core/contracts"
"github.com/Rain-kl/Wavelet/plugins/domain/admin"
"github.com/Rain-kl/Wavelet/plugins/domain/auth"
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway"
"github.com/Rain-kl/Wavelet/plugins/domain/risk_control"
"github.com/Rain-kl/Wavelet/plugins/domain/user"
"github.com/Rain-kl/Wavelet/plugins/infra/cache"
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
"github.com/Rain-kl/Wavelet/plugins/infra/logger"
"github.com/Rain-kl/Wavelet/plugins/infra/storage"
"Wavelet/core"
"Wavelet/core/contracts"
"Wavelet/plugins/domain/admin"
"Wavelet/plugins/domain/auth"
"Wavelet/plugins/domain/message_gateway"
"Wavelet/plugins/domain/risk_control"
"Wavelet/plugins/domain/user"
"Wavelet/plugins/infra/cache"
db "Wavelet/plugins/infra/database"
"Wavelet/plugins/infra/logger"
"Wavelet/plugins/infra/storage"
)
func setupTestDB(t *testing.T) *gorm.DB {
@@ -7,7 +7,7 @@ import (
"net/http"
"strconv"
"github.com/Rain-kl/Wavelet/pkg/response"
"Wavelet/pkg/response"
"github.com/gin-gonic/gin"
)
@@ -11,8 +11,8 @@ import (
"sync"
"time"
"github.com/Rain-kl/Wavelet/pkg/logger"
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway"
"Wavelet/pkg/logger"
"Wavelet/plugins/domain/message_gateway"
"github.com/tencent-connect/botgo"
"github.com/tencent-connect/botgo/dto"
"github.com/tencent-connect/botgo/event"
@@ -7,7 +7,7 @@ import (
"context"
"testing"
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway"
"Wavelet/plugins/domain/message_gateway"
)
func TestHandleEvent_DropsNonC2C(t *testing.T) {
@@ -12,7 +12,7 @@ import (
"strconv"
"strings"
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway"
"Wavelet/plugins/domain/message_gateway"
tele "gopkg.in/telebot.v4"
)
@@ -7,7 +7,7 @@ import (
"context"
"testing"
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway"
"Wavelet/plugins/domain/message_gateway"
tele "gopkg.in/telebot.v4"
)
@@ -7,7 +7,7 @@ import (
"context"
"time"
"github.com/Rain-kl/Wavelet/core/contracts"
"Wavelet/core/contracts"
)
// AdminLogin is the metadata definition for the admin login event.
@@ -8,9 +8,9 @@ import (
"net/http"
"strconv"
"github.com/Rain-kl/Wavelet/core/contracts"
"github.com/Rain-kl/Wavelet/pkg/response"
"github.com/Rain-kl/Wavelet/pkg/util"
"Wavelet/core/contracts"
"Wavelet/pkg/response"
"Wavelet/pkg/util"
"github.com/gin-gonic/gin"
)
@@ -8,8 +8,8 @@ import (
"testing"
"time"
"github.com/Rain-kl/Wavelet/pkg/testhelper"
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway"
"Wavelet/pkg/testhelper"
"Wavelet/plugins/domain/message_gateway"
)
func TestUpsertPairingCode_ReusesUnexpired(t *testing.T) {
@@ -8,9 +8,9 @@ import (
"context"
"embed"
"github.com/Rain-kl/Wavelet/core"
"github.com/Rain-kl/Wavelet/core/contracts"
"github.com/Rain-kl/Wavelet/core/extpoints"
"Wavelet/core"
"Wavelet/core/contracts"
"Wavelet/core/extpoints"
"github.com/gin-gonic/gin"
"github.com/hibiken/asynq"
)
@@ -11,8 +11,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/Rain-kl/Wavelet/core"
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway"
"Wavelet/core"
"Wavelet/plugins/domain/message_gateway"
)
func TestMessageGatewayPluginUnit(t *testing.T) {
@@ -13,7 +13,7 @@ import (
"net/http"
"strings"
"github.com/Rain-kl/Wavelet/pkg/httppool"
"Wavelet/pkg/httppool"
)
func init() {
@@ -11,7 +11,7 @@ import (
"net/smtp"
"strings"
"github.com/Rain-kl/Wavelet/pkg/util"
"Wavelet/pkg/util"
)
func init() {
@@ -17,7 +17,7 @@ import (
"strings"
"time"
"github.com/Rain-kl/Wavelet/pkg/httppool"
"Wavelet/pkg/httppool"
)
func init() {
@@ -12,7 +12,7 @@ import (
"net/http"
"strings"
"github.com/Rain-kl/Wavelet/pkg/httppool"
"Wavelet/pkg/httppool"
)
func init() {
@@ -11,8 +11,8 @@ import (
"strings"
"sync"
"github.com/Rain-kl/Wavelet/pkg/response"
pkgpush "github.com/Rain-kl/Wavelet/plugins/domain/message_gateway/push"
"Wavelet/pkg/response"
pkgpush "Wavelet/plugins/domain/message_gateway/push"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
)
@@ -9,11 +9,11 @@ import (
"errors"
"sync"
"github.com/Rain-kl/Wavelet/pkg/logger"
"Wavelet/pkg/logger"
pkgpush "github.com/Rain-kl/Wavelet/plugins/domain/message_gateway/push"
pkgpush "Wavelet/plugins/domain/message_gateway/push"
"github.com/Rain-kl/Wavelet/pkg/util"
"Wavelet/pkg/util"
"gorm.io/gorm"
)
@@ -9,9 +9,9 @@ import (
"net/http"
"strconv"
pkgpush "github.com/Rain-kl/Wavelet/plugins/domain/message_gateway/push"
pkgpush "Wavelet/plugins/domain/message_gateway/push"
"github.com/Rain-kl/Wavelet/pkg/response"
"Wavelet/pkg/response"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
)
@@ -11,10 +11,10 @@ import (
"strconv"
"strings"
"github.com/Rain-kl/Wavelet/core/contracts"
pkgpush "github.com/Rain-kl/Wavelet/plugins/domain/message_gateway/push"
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_asynq_worker"
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
"Wavelet/core/contracts"
pkgpush "Wavelet/plugins/domain/message_gateway/push"
"Wavelet/plugins/drivers/driver_asynq_worker"
db "Wavelet/plugins/infra/database"
"gorm.io/gorm"
)
@@ -9,8 +9,8 @@ import (
"strconv"
"time"
"github.com/Rain-kl/Wavelet/pkg/logger"
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_asynq_worker"
"Wavelet/pkg/logger"
"Wavelet/plugins/drivers/driver_asynq_worker"
)
// RegisterTaskListeners subscribes push notification handlers to task completion events.
@@ -9,8 +9,8 @@ import (
"errors"
"fmt"
"github.com/Rain-kl/Wavelet/plugins/domain/message_gateway/push"
"github.com/Rain-kl/Wavelet/plugins/drivers/driver_asynq_worker"
"Wavelet/plugins/domain/message_gateway/push"
"Wavelet/plugins/drivers/driver_asynq_worker"
)
const (
@@ -10,9 +10,9 @@ import (
"gorm.io/gorm"
"github.com/Rain-kl/Wavelet/pkg/idgen"
cachepkg "github.com/Rain-kl/Wavelet/plugins/infra/cache"
db "github.com/Rain-kl/Wavelet/plugins/infra/database"
"Wavelet/pkg/idgen"
cachepkg "Wavelet/plugins/infra/cache"
db "Wavelet/plugins/infra/database"
)
const (
@@ -7,7 +7,7 @@ import (
"context"
"sync"
"github.com/Rain-kl/Wavelet/pkg/logger"
"Wavelet/pkg/logger"
)
// Runner manages lifecycle for long-lived channel adapters (WebSocket, long-polling, etc.).

Some files were not shown because too many files have changed in this diff Show More