github.com/olli-ai/jx/v2@v2.0.400-0.20210921045218-14731b4dd448/pkg/util/interface.go (about) 1 package util 2 3 import ( 4 "time" 5 6 "github.com/cenkalti/backoff" 7 ) 8 9 // Commander defines the interface for a Command 10 //go:generate pegomock generate github.com/olli-ai/jx/v2/pkg/util Commander -o mocks/commander.go 11 type Commander interface { 12 DidError() bool 13 DidFail() bool 14 Error() error 15 Run() (string, error) 16 RunWithoutRetry() (string, error) 17 SetName(string) 18 CurrentName() string 19 SetDir(string) 20 CurrentDir() string 21 SetArgs([]string) 22 CurrentArgs() []string 23 SetTimeout(time.Duration) 24 SetExponentialBackOff(*backoff.ExponentialBackOff) 25 SetEnv(map[string]string) 26 CurrentEnv() map[string]string 27 SetEnvVariable(string, string) 28 }