instances

package
v0.0.0-...-84590b4 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeInstanceGetter

type FakeInstanceGetter struct {
}

FakeInstanceGetter to be used for tests.

func (*FakeInstanceGetter) GetInstance

func (g *FakeInstanceGetter) GetInstance(igURL string) (*compute.Instance, error)

GetInstance retuns a new instance.

type InstanceGetter

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

InstanceGetter is an implementation of InstanceGetterInterface.

func (*InstanceGetter) GetInstance

func (g *InstanceGetter) GetInstance(igURL string) (*compute.Instance, error)

GetInstance gets an instance in the given instance group.

type InstanceGetterInterface

type InstanceGetterInterface interface {
	// GetIntance returns an instance in the given instance group.
	// There is no guarantee regarding which instance is returned.
	// Calling this multiple times for the same instance group can return different instances.
	GetInstance(igURL string) (*compute.Instance, error)
}

InstanceGetterInterface is an interface to fetch GCE instances. TODO(nikhiljindal): Move this logic to gce cloudprovider in kubernetes/kubernetes.

func NewFakeInstanceGetter

func NewFakeInstanceGetter() InstanceGetterInterface

NewFakeInstanceGetter returns a new fake.

func NewInstanceGetter

func NewInstanceGetter(projectID string) (InstanceGetterInterface, error)

NewInstanceGetter returns an InstanceGetter implementation.

Jump to

Keyboard shortcuts

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