mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
add --connector switch, validation
This commit is contained in:
@@ -19,7 +19,7 @@ type Docker struct {
|
||||
lock sync.RWMutex
|
||||
}
|
||||
|
||||
func NewDocker() *Docker {
|
||||
func NewDocker() Connector {
|
||||
// init docker client
|
||||
client, err := api.NewClientFromEnv()
|
||||
if err != nil {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
var log = logging.Init()
|
||||
|
||||
type ContainerSource interface {
|
||||
type Connector interface {
|
||||
All() container.Containers
|
||||
Get(string) (*container.Container, bool)
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ func getFactory(opts RuncOpts) (libcontainer.Factory, error) {
|
||||
return libcontainer.New(opts.root, cgroupManager, libcontainer.CriuPath("criu"))
|
||||
}
|
||||
|
||||
func NewRunc() *Runc {
|
||||
func NewRunc() Connector {
|
||||
opts, err := readRuncOpts()
|
||||
runcFailOnErr(err)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user