dependency

package
v1.78.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 18 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithExternalDependencies

func WithExternalDependencies(f func(ctx context.Context, input *go_hook.HookInput, dc Container) error) func(ctx context.Context, input *go_hook.HookInput) error

WithExternalDependencies decorate function with external dependencies

Types

type Container

type Container interface {
	GetHTTPClient(options ...http.Option) http.Client
	GetEtcdClient(endpoints []string, options ...etcd.Option) (etcd.Client, error)
	MustGetEtcdClient(endpoints []string, options ...etcd.Option) etcd.Client
	GetK8sClient(options ...k8s.Option) (k8s.Client, error)
	MustGetK8sClient(options ...k8s.Option) k8s.Client
	GetRegistryClient(repo string, options ...cr.Option) (cr.Client, error)
	GetVsphereClient(config *vsphere.ProviderClusterConfiguration) (vsphere.Client, error)
	GetClientConfig() (*rest.Config, error)
	GetClock() clockwork.Clock
}

Container with external dependencies

func NewDependencyContainer

func NewDependencyContainer() Container

NewDependencyContainer creates new Dependency container with external clients

type MockedContainer added in v1.65.0

type MockedContainer struct {
	HTTPClient    *http.ClientMock
	EtcdClient    *etcd.ClientMock
	K8sClient     k8s.Client
	CRClient      *cr.ClientMock
	CRClientMap   map[string]cr.Client
	VsphereClient *vsphere.ClientMock
	// contains filtered or unexported fields
}

Mocks

var (
	TestDC       *MockedContainer
	TestTimeZone = time.UTC
)

func NewMockedContainer added in v1.65.0

func NewMockedContainer() *MockedContainer

func (*MockedContainer) GetClientConfig added in v1.65.0

func (c *MockedContainer) GetClientConfig() (*rest.Config, error)

func (*MockedContainer) GetClock added in v1.65.0

func (c *MockedContainer) GetClock() clockwork.Clock

func (*MockedContainer) GetEtcdClient added in v1.65.0

func (c *MockedContainer) GetEtcdClient(_ []string, _ ...etcd.Option) (etcd.Client, error)

func (*MockedContainer) GetFakeClock added in v1.65.0

func (c *MockedContainer) GetFakeClock() *clockwork.FakeClock

func (*MockedContainer) GetHTTPClient added in v1.65.0

func (c *MockedContainer) GetHTTPClient(_ ...http.Option) http.Client

func (*MockedContainer) GetK8sClient added in v1.65.0

func (c *MockedContainer) GetK8sClient(_ ...k8s.Option) (k8s.Client, error)

func (*MockedContainer) GetRegistryClient added in v1.65.0

func (c *MockedContainer) GetRegistryClient(path string, _ ...cr.Option) (cr.Client, error)

func (*MockedContainer) GetVsphereClient added in v1.65.0

func (*MockedContainer) MustGetEtcdClient added in v1.65.0

func (c *MockedContainer) MustGetEtcdClient(_ []string, _ ...etcd.Option) etcd.Client

func (*MockedContainer) MustGetK8sClient added in v1.65.0

func (c *MockedContainer) MustGetK8sClient(options ...k8s.Option) k8s.Client

func (*MockedContainer) SetK8sVersion added in v1.65.0

func (c *MockedContainer) SetK8sVersion(ver k8s.FakeClusterVersion)

SetK8sVersion change FakeCluster versions. KubeClient returns with resources of specified version

Jump to

Keyboard shortcuts

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