iface

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package iface defines an interface for accessing Google Compute & Container APIs, and helps mediate access to k8s clients. This is helpful for creating testable packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GKE

type GKE interface {
	ZonePages(ctx context.Context, f func(zones *compute.ZoneList) error) error
	ClusterList(ctx context.Context, zone string) (*container.ListClustersResponse, error)
	GetKubeClient(c *container.Cluster) (kubernetes.Interface, error)
}

GKE defines the interface used by the gke logic.

type GKEImpl

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

GKEImpl implements the GKE interface.

func NewGKE

func NewGKE(project string, compute *compute.Service, container *container.Service,
	getKubeClient func(c *container.Cluster) (kubernetes.Interface, error)) *GKEImpl

NewGKE creates a new GKE instance.

func (*GKEImpl) ClusterList

func (g *GKEImpl) ClusterList(ctx context.Context, zone string) (*container.ListClustersResponse, error)

ClusterList wraps the container service Clusters.List method for the given zone.

func (*GKEImpl) GetKubeClient

func (g *GKEImpl) GetKubeClient(c *container.Cluster) (kubernetes.Interface, error)

GetKubeClient returns a kubernetes interface for the given cluster.

func (*GKEImpl) ZonePages

func (g *GKEImpl) ZonePages(ctx context.Context, f func(zones *compute.ZoneList) error) error

ZonePages wraps the computeService Zones.List().Pages method.

Jump to

Keyboard shortcuts

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