Skip to content

Commit

Permalink
refactor: 将内部包改为公共包
Browse files Browse the repository at this point in the history
- 将 internal/kubectl 改为 pkg/comm/kubectl
- 将 internal/utils改为 pkg/comm/utils
- 更新相关文件的导入路径
- 重命名部分文件以适应新路径
  • Loading branch information
weibaohui committed Oct 19, 2024
1 parent 38ee667 commit 7ffd4ba
Show file tree
Hide file tree
Showing 46 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/gin-contrib/gzip"
"github.com/gin-gonic/gin"
"github.com/weibaohui/k8m/flag"
"github.com/weibaohui/k8m/internal/kubectl"
"github.com/weibaohui/k8m/pkg/callback"
"github.com/weibaohui/k8m/pkg/comm/kubectl"
"github.com/weibaohui/k8m/pkg/controller/chat"
"github.com/weibaohui/k8m/pkg/controller/deploy"
"github.com/weibaohui/k8m/pkg/controller/doc"
Expand Down
2 changes: 1 addition & 1 deletion pkg/callback/cb.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package callback
import (
"context"

"github.com/weibaohui/k8m/internal/kubectl"
"github.com/weibaohui/k8m/pkg/comm/kubectl"
"k8s.io/klog/v2"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion internal/kubectl/doc.go → pkg/comm/kubectl/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"strings"

"github.com/weibaohui/k8m/internal/utils"
"github.com/weibaohui/k8m/pkg/comm/utils"
"k8s.io/klog/v2"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os"
"strings"

"github.com/weibaohui/k8m/internal/utils"
"github.com/weibaohui/k8m/pkg/comm/utils"
"k8s.io/client-go/tools/remotecommand"
"k8s.io/klog/v2"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package kubectl

import (
"github.com/weibaohui/k8m/internal/utils"
"github.com/weibaohui/k8m/pkg/comm/utils"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/controller/chat/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/gin-gonic/gin"
"github.com/sashabaranov/go-openai"
"github.com/weibaohui/k8m/internal/utils/amis"
"github.com/weibaohui/k8m/pkg/comm/utils/amis"
"github.com/weibaohui/k8m/pkg/service"
"k8s.io/klog/v2"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package deploy

import (
"github.com/gin-gonic/gin"
"github.com/weibaohui/k8m/internal/kubectl"
"github.com/weibaohui/k8m/internal/utils/amis"
"github.com/weibaohui/k8m/pkg/comm/kubectl"
"github.com/weibaohui/k8m/pkg/comm/utils/amis"
)

func UpdateImageTag(c *gin.Context) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/doc/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"

"github.com/gin-gonic/gin"
"github.com/weibaohui/k8m/internal/kubectl"
"github.com/weibaohui/k8m/internal/utils"
"github.com/weibaohui/k8m/internal/utils/amis"
"github.com/weibaohui/k8m/pkg/comm/kubectl"
"github.com/weibaohui/k8m/pkg/comm/utils"
"github.com/weibaohui/k8m/pkg/comm/utils/amis"
"github.com/weibaohui/k8m/pkg/service"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/dynamic/dynamic.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"

"github.com/gin-gonic/gin"
"github.com/weibaohui/k8m/internal/kubectl"
"github.com/weibaohui/k8m/internal/utils/amis"
"github.com/weibaohui/k8m/pkg/comm/kubectl"
"github.com/weibaohui/k8m/pkg/comm/utils/amis"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"sigs.k8s.io/yaml"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/ns/ns.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package ns

import (
"github.com/gin-gonic/gin"
"github.com/weibaohui/k8m/internal/kubectl"
"github.com/weibaohui/k8m/internal/utils/amis"
"github.com/weibaohui/k8m/pkg/comm/kubectl"
"github.com/weibaohui/k8m/pkg/comm/utils/amis"
)

func OptionList(c *gin.Context) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/pod/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"

"github.com/gin-gonic/gin"
"github.com/weibaohui/k8m/internal/kubectl"
"github.com/weibaohui/k8m/internal/utils/amis"
"github.com/weibaohui/k8m/pkg/comm/kubectl"
"github.com/weibaohui/k8m/pkg/comm/utils/amis"
"github.com/weibaohui/k8m/pkg/controller/sse"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/pod/pod_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"path/filepath"

"github.com/gin-gonic/gin"
"github.com/weibaohui/k8m/internal/kubectl"
"github.com/weibaohui/k8m/internal/utils"
"github.com/weibaohui/k8m/internal/utils/amis"
"github.com/weibaohui/k8m/pkg/comm/kubectl"
"github.com/weibaohui/k8m/pkg/comm/utils"
"github.com/weibaohui/k8m/pkg/comm/utils/amis"
"k8s.io/klog/v2"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/sse/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"

"github.com/gin-gonic/gin"
"github.com/weibaohui/k8m/internal/utils/amis"
"github.com/weibaohui/k8m/pkg/comm/utils/amis"
v1 "k8s.io/api/core/v1"
"k8s.io/klog/v2"
)
Expand Down

0 comments on commit 7ffd4ba

Please sign in to comment.