client

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateApiserverClient

func CreateApiserverClient(apiserverHost string, kubeConfig string) (*client.Client, clientcmd.ClientConfig, error)

CreateApiserverClient creates new Kubernetes Apiserver client. When kubeconfig or apiserverHost param is empty the function assumes that it is running inside a Kubernetes cluster and attempts to discover the Apiserver. Otherwise, it connects to the Apiserver specified.

apiserverHost param is in the format of protocol://address:port/pathPrefix, e.g.http://localhost:8001. kubeConfig location of kubeconfig file

Types

type HeapsterClient

type HeapsterClient interface {
	// Creates a new GET HTTP request to heapster, specified by the path param, to the V1 API
	// endpoint. The path param is without the API prefix, e.g.,
	// /model/namespaces/default/pod-list/foo/metrics/memory-usage
	Get(path string) RequestInterface
}

HeapsterClient is a client used to make requests to a Heapster instance.

func CreateHeapsterRESTClient

func CreateHeapsterRESTClient(heapsterHost string, apiclient *client.Client) (
	HeapsterClient, error)

CreateHeapsterRESTClient creates new Heapster REST client. When heapsterHost param is empty string the function assumes that it is running inside a Kubernetes cluster and connects via service proxy. heapsterHost param is in the format of protocol://address:port, e.g., http://localhost:8002.

type InClusterHeapsterClient

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

InClusterHeapsterClient is an in-cluster implementation of a Heapster client. Talks with Heapster through service proxy.

func (InClusterHeapsterClient) Get

Get creates request to given path.

type RemoteHeapsterClient

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

RemoteHeapsterClient is an implementation of a remote Heapster client. Talks with Heapster through raw RESTClient.

func (RemoteHeapsterClient) Get

Get creates request to given path.

type RequestInterface

type RequestInterface interface {
	DoRaw() ([]byte, error)
}

RequestInterface is an interface that allows to make operations on pure request object. Separation is done to allow testing.

Jump to

Keyboard shortcuts

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