Skip to content

Commit

Permalink
feat: 使用cli实现容器管理
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Oct 27, 2024
1 parent 2783e2b commit 7521b0f
Show file tree
Hide file tree
Showing 6 changed files with 227 additions and 170 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/bddjr/hlfhr v1.1.2
github.com/beevik/ntp v1.4.3
github.com/docker/docker v27.3.1+incompatible
github.com/docker/go-connections v0.5.0
github.com/expr-lang/expr v1.16.9
github.com/glebarez/sqlite v1.11.0
github.com/go-chi/chi/v5 v5.1.0
Expand Down Expand Up @@ -63,6 +62,7 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/devhaozi/huaweicloud-sdk-go-v3 v0.0.0-20241018211007-bbebb6de5db7 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
Expand Down
7 changes: 2 additions & 5 deletions internal/biz/container.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package biz

import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"

"github.com/TheTNB/panel/internal/http/request"
"github.com/TheTNB/panel/pkg/types"
)

type ContainerRepo interface {
ListAll() ([]types.Container, error)
ListByNames(names []string) ([]types.Container, error)
ListByName(name string) ([]types.Container, error)
Create(req *request.ContainerCreate) (string, error)
Remove(id string) error
Start(id string) error
Expand All @@ -19,7 +17,6 @@ type ContainerRepo interface {
Unpause(id string) error
Kill(id string) error
Rename(id string, newName string) error
Update(id string, config container.UpdateConfig) error
Logs(id string) (string, error)
Prune() error
}
Loading

0 comments on commit 7521b0f

Please sign in to comment.