cmd

package
v1.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2023 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

Set provides an implementation and interface for Cmd.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	Root     *Root
	GetToken *GetToken
	Setup    *Setup
	Logger   logger.Interface
}

Cmd provides interaction with command line interface (CLI).

func (*Cmd) Run

func (cmd *Cmd) Run(ctx context.Context, args []string, version string) int

Run parses the command line arguments and executes the specified use-case. It returns an exit code, that is 0 on success or 1 on error.

type GetToken

type GetToken struct {
	GetToken credentialplugin.Interface
	Logger   logger.Interface
}

func (*GetToken) New

func (cmd *GetToken) New() *cobra.Command

type Interface

type Interface interface {
	Run(ctx context.Context, args []string, version string) int
}

type MockInterface added in v1.25.2

type MockInterface struct {
	mock.Mock
}

MockInterface is an autogenerated mock type for the Interface type

func NewMockInterface added in v1.25.2

func NewMockInterface(t mockConstructorTestingTNewMockInterface) *MockInterface

NewMockInterface creates a new instance of MockInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockInterface) EXPECT added in v1.25.2

func (_m *MockInterface) EXPECT() *MockInterface_Expecter

func (*MockInterface) Run added in v1.25.2

func (_m *MockInterface) Run(ctx context.Context, args []string, version string) int

Run provides a mock function with given fields: ctx, args, version

type MockInterface_Expecter added in v1.25.2

type MockInterface_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockInterface_Expecter) Run added in v1.25.2

func (_e *MockInterface_Expecter) Run(ctx interface{}, args interface{}, version interface{}) *MockInterface_Run_Call

Run is a helper method to define mock.On call

  • ctx context.Context
  • args []string
  • version string

type MockInterface_Run_Call added in v1.25.2

type MockInterface_Run_Call struct {
	*mock.Call
}

MockInterface_Run_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Run'

func (*MockInterface_Run_Call) Return added in v1.25.2

func (*MockInterface_Run_Call) Run added in v1.25.2

func (_c *MockInterface_Run_Call) Run(run func(ctx context.Context, args []string, version string)) *MockInterface_Run_Call

type Root

type Root struct {
	Standalone standalone.Interface
	Logger     logger.Interface
}

func (*Root) New

func (cmd *Root) New() *cobra.Command

type Setup

type Setup struct {
	Setup setup.Interface
}

func (*Setup) New

func (cmd *Setup) New() *cobra.Command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL