 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- func NewCmdExtensions(f *cmdutil.Factory) *cobra.Command
- type Extension
- type ExtensionManagerMock
- func (mock *ExtensionManagerMock) Dispatch(args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) (bool, error)
- func (mock *ExtensionManagerMock) DispatchCalls() []struct{ ... }
- func (mock *ExtensionManagerMock) Install(url string, stdout io.Writer, stderr io.Writer) error
- func (mock *ExtensionManagerMock) InstallCalls() []struct{ ... }
- func (mock *ExtensionManagerMock) InstallLocal(dir string) error
- func (mock *ExtensionManagerMock) InstallLocalCalls() []struct{ ... }
- func (mock *ExtensionManagerMock) List() []Extension
- func (mock *ExtensionManagerMock) ListCalls() []struct{}
- func (mock *ExtensionManagerMock) Remove(name string) error
- func (mock *ExtensionManagerMock) RemoveCalls() []struct{ ... }
- func (mock *ExtensionManagerMock) Upgrade(name string, stdout io.Writer, stderr io.Writer) error
- func (mock *ExtensionManagerMock) UpgradeCalls() []struct{ ... }
 
- type ExtensionMock
- type Manager
- func (m *Manager) Dispatch(args []string, stdin io.Reader, stdout, stderr io.Writer) (bool, error)
- func (m *Manager) Install(cloneURL string, stdout, stderr io.Writer) error
- func (m *Manager) InstallLocal(dir string) error
- func (m *Manager) List() []extensions.Extension
- func (m *Manager) Remove(name string) error
- func (m *Manager) Upgrade(name string, stdout, stderr io.Writer) error
 
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ExtensionManagerMock ¶
type ExtensionManagerMock struct {
	// DispatchFunc mocks the Dispatch method.
	DispatchFunc func(args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) (bool, error)
	// InstallFunc mocks the Install method.
	InstallFunc func(url string, stdout io.Writer, stderr io.Writer) error
	// InstallLocalFunc mocks the InstallLocal method.
	InstallLocalFunc func(dir string) error
	// ListFunc mocks the List method.
	ListFunc func() []Extension
	// RemoveFunc mocks the Remove method.
	RemoveFunc func(name string) error
	// UpgradeFunc mocks the Upgrade method.
	UpgradeFunc func(name string, stdout io.Writer, stderr io.Writer) error
	// contains filtered or unexported fields
}
    ExtensionManagerMock is a mock implementation of ExtensionManager.
func TestSomethingThatUsesExtensionManager(t *testing.T) {
	// make and configure a mocked ExtensionManager
	mockedExtensionManager := &ExtensionManagerMock{
		DispatchFunc: func(args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) (bool, error) {
			panic("mock out the Dispatch method")
		},
		InstallFunc: func(url string, stdout io.Writer, stderr io.Writer) error {
			panic("mock out the Install method")
		},
		InstallLocalFunc: func(dir string) error {
			panic("mock out the InstallLocal method")
		},
		ListFunc: func() []Extension {
			panic("mock out the List method")
		},
		RemoveFunc: func(name string) error {
			panic("mock out the Remove method")
		},
		UpgradeFunc: func(name string, stdout io.Writer, stderr io.Writer) error {
			panic("mock out the Upgrade method")
		},
	}
	// use mockedExtensionManager in code that requires ExtensionManager
	// and then make assertions.
}
func (*ExtensionManagerMock) Dispatch ¶
func (mock *ExtensionManagerMock) Dispatch(args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) (bool, error)
Dispatch calls DispatchFunc.
func (*ExtensionManagerMock) DispatchCalls ¶
func (mock *ExtensionManagerMock) DispatchCalls() []struct { Args []string Stdin io.Reader Stdout io.Writer Stderr io.Writer }
DispatchCalls gets all the calls that were made to Dispatch. Check the length with:
len(mockedExtensionManager.DispatchCalls())
func (*ExtensionManagerMock) InstallCalls ¶
func (mock *ExtensionManagerMock) InstallCalls() []struct { URL string Stdout io.Writer Stderr io.Writer }
InstallCalls gets all the calls that were made to Install. Check the length with:
len(mockedExtensionManager.InstallCalls())
func (*ExtensionManagerMock) InstallLocal ¶
func (mock *ExtensionManagerMock) InstallLocal(dir string) error
InstallLocal calls InstallLocalFunc.
func (*ExtensionManagerMock) InstallLocalCalls ¶
func (mock *ExtensionManagerMock) InstallLocalCalls() []struct { Dir string }
InstallLocalCalls gets all the calls that were made to InstallLocal. Check the length with:
len(mockedExtensionManager.InstallLocalCalls())
func (*ExtensionManagerMock) List ¶
func (mock *ExtensionManagerMock) List() []Extension
List calls ListFunc.
func (*ExtensionManagerMock) ListCalls ¶
func (mock *ExtensionManagerMock) ListCalls() []struct{}
ListCalls gets all the calls that were made to List. Check the length with:
len(mockedExtensionManager.ListCalls())
func (*ExtensionManagerMock) Remove ¶
func (mock *ExtensionManagerMock) Remove(name string) error
Remove calls RemoveFunc.
func (*ExtensionManagerMock) RemoveCalls ¶
func (mock *ExtensionManagerMock) RemoveCalls() []struct { Name string }
RemoveCalls gets all the calls that were made to Remove. Check the length with:
len(mockedExtensionManager.RemoveCalls())
func (*ExtensionManagerMock) UpgradeCalls ¶
func (mock *ExtensionManagerMock) UpgradeCalls() []struct { Name string Stdout io.Writer Stderr io.Writer }
UpgradeCalls gets all the calls that were made to Upgrade. Check the length with:
len(mockedExtensionManager.UpgradeCalls())
type ExtensionMock ¶
type ExtensionMock struct {
	// NameFunc mocks the Name method.
	NameFunc func() string
	// PathFunc mocks the Path method.
	PathFunc func() string
	// URLFunc mocks the URL method.
	URLFunc func() string
	// contains filtered or unexported fields
}
    ExtensionMock is a mock implementation of Extension.
func TestSomethingThatUsesExtension(t *testing.T) {
	// make and configure a mocked Extension
	mockedExtension := &ExtensionMock{
		NameFunc: func() string {
			panic("mock out the Name method")
		},
		PathFunc: func() string {
			panic("mock out the Path method")
		},
		URLFunc: func() string {
			panic("mock out the URL method")
		},
	}
	// use mockedExtension in code that requires Extension
	// and then make assertions.
}
func (*ExtensionMock) NameCalls ¶
func (mock *ExtensionMock) NameCalls() []struct{}
NameCalls gets all the calls that were made to Name. Check the length with:
len(mockedExtension.NameCalls())
func (*ExtensionMock) PathCalls ¶
func (mock *ExtensionMock) PathCalls() []struct{}
PathCalls gets all the calls that were made to Path. Check the length with:
len(mockedExtension.PathCalls())
func (*ExtensionMock) URLCalls ¶
func (mock *ExtensionMock) URLCalls() []struct{}
URLCalls gets all the calls that were made to URL. Check the length with:
len(mockedExtension.URLCalls())