Skip to content

Commit

Permalink
return static error on unimplemented manager actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bcicen committed Oct 26, 2020
1 parent c5038e2 commit 53ec5c9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Option | Description
`-s` | select initial container sort field
`-scale-cpu` | show cpu as % of system total
`-v` | output version information and exit
`-shell` | specify shell (default: sh)
`-shell` | exec shell to use (default: sh)

### Keybindings

Expand Down
4 changes: 4 additions & 0 deletions connector/manager/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package manager

import "errors"

var ActionNotImplErr = errors.New("action not implemented")

type Manager interface {
Start() error
Stop() error
Expand Down
14 changes: 7 additions & 7 deletions connector/manager/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ func NewMock() *Mock {
}

func (m *Mock) Start() error {
return nil
return ActionNotImplErr
}

func (m *Mock) Stop() error {
return nil
return ActionNotImplErr
}

func (m *Mock) Remove() error {
return nil
return ActionNotImplErr
}

func (m *Mock) Pause() error {
return nil
return ActionNotImplErr
}

func (m *Mock) Unpause() error {
return nil
return ActionNotImplErr
}

func (m *Mock) Restart() error {
return nil
return ActionNotImplErr
}

func (m *Mock) Exec(cmd []string) error {
return nil
return ActionNotImplErr
}
14 changes: 7 additions & 7 deletions connector/manager/runc.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ func NewRunc() *Runc {
}

func (rc *Runc) Start() error {
return nil
return ActionNotImplErr
}

func (rc *Runc) Stop() error {
return nil
return ActionNotImplErr
}

func (rc *Runc) Remove() error {
return nil
return ActionNotImplErr
}

func (rc *Runc) Pause() error {
return nil
return ActionNotImplErr
}

func (rc *Runc) Unpause() error {
return nil
return ActionNotImplErr
}

func (rc *Runc) Restart() error {
return nil
return ActionNotImplErr
}

func (rc *Runc) Exec(cmd []string) error {
return nil
return ActionNotImplErr
}
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func main() {
invertFlag = flag.Bool("i", false, "invert default colors")
scaleCpu = flag.Bool("scale-cpu", false, "show cpu as % of system total")
connectorFlag = flag.String("connector", "docker", "container connector to use")
defaultShell = flag.String("shell", "", "default shell")
defaultShell = flag.String("shell", "sh", "exec shell to use")
)
flag.Parse()

Expand Down

0 comments on commit 53ec5c9

Please sign in to comment.