state

package
v1.43.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package state is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayProgressCircle added in v1.39.0

func DisplayProgressCircle(cmd *cobra.Command, errCh <-chan error, waitingFor string) error

func StdoutIsTerminal added in v1.39.0

func StdoutIsTerminal() bool

StdoutIsTerminal returns whether the CLI is run in a terminal.

func Wrap added in v1.42.0

func Wrap(s State, f func(State, *cobra.Command, []string) error) func(*cobra.Command, []string) error

func WrapCtx added in v1.23.0

func WrapCtx(
	ctx context.Context,
	fn func(context.Context, *cobra.Command, []string) error,
) func(*cobra.Command, []string) error

Types

type ActionWaiter added in v1.23.0

type ActionWaiter interface {
	ActionProgress(*cobra.Command, context.Context, *hcloud.Action) error
	WaitForActions(*cobra.Command, context.Context, []*hcloud.Action) error
}

type MockActionWaiter added in v1.23.0

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

MockActionWaiter is a mock of ActionWaiter interface.

func NewMockActionWaiter added in v1.23.0

func NewMockActionWaiter(ctrl *gomock.Controller) *MockActionWaiter

NewMockActionWaiter creates a new mock instance.

func (*MockActionWaiter) ActionProgress added in v1.23.0

func (m *MockActionWaiter) ActionProgress(arg0 *cobra.Command, arg1 context.Context, arg2 *hcloud.Action) error

ActionProgress mocks base method.

func (*MockActionWaiter) EXPECT added in v1.23.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockActionWaiter) WaitForActions added in v1.23.0

func (m *MockActionWaiter) WaitForActions(arg0 *cobra.Command, arg1 context.Context, arg2 []*hcloud.Action) error

WaitForActions mocks base method.

type MockActionWaiterMockRecorder added in v1.23.0

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

MockActionWaiterMockRecorder is the mock recorder for MockActionWaiter.

func (*MockActionWaiterMockRecorder) ActionProgress added in v1.23.0

func (mr *MockActionWaiterMockRecorder) ActionProgress(arg0, arg1, arg2 interface{}) *gomock.Call

ActionProgress indicates an expected call of ActionProgress.

func (*MockActionWaiterMockRecorder) WaitForActions added in v1.23.0

func (mr *MockActionWaiterMockRecorder) WaitForActions(arg0, arg1, arg2 interface{}) *gomock.Call

WaitForActions indicates an expected call of WaitForActions.

type MockTokenEnsurer added in v1.23.0

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

MockTokenEnsurer is a mock of TokenEnsurer interface.

func NewMockTokenEnsurer added in v1.23.0

func NewMockTokenEnsurer(ctrl *gomock.Controller) *MockTokenEnsurer

NewMockTokenEnsurer creates a new mock instance.

func (*MockTokenEnsurer) EXPECT added in v1.23.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockTokenEnsurer) EnsureToken added in v1.23.0

func (m *MockTokenEnsurer) EnsureToken(arg0 *cobra.Command, arg1 []string) error

EnsureToken mocks base method.

type MockTokenEnsurerMockRecorder added in v1.23.0

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

MockTokenEnsurerMockRecorder is the mock recorder for MockTokenEnsurer.

func (*MockTokenEnsurerMockRecorder) EnsureToken added in v1.23.0

func (mr *MockTokenEnsurerMockRecorder) EnsureToken(arg0, arg1 interface{}) *gomock.Call

EnsureToken indicates an expected call of EnsureToken.

type State

type State interface {
	context.Context

	TokenEnsurer
	ActionWaiter

	Client() hcapi2.Client
	Config() config.Config
}

func New

func New(cfg config.Config) (State, error)

type TokenEnsurer added in v1.23.0

type TokenEnsurer interface {
	EnsureToken(cmd *cobra.Command, args []string) error
}

Directories

Path Synopsis
Package config is a generated GoMock package.
Package config is a generated GoMock package.

Jump to

Keyboard shortcuts

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