client

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// High enough QPS to fit all expected use cases. QPS=0 is not set here, because
	// client code is overriding it.
	DefaultQPS = 1e6
	// High enough Burst to fit all expected use cases. Burst=0 is not set here, because
	// client code is overriding it.
	DefaultBurst = 1e6
	// Use kubernetes protobuf as content type by default
	DefaultContentType = "application/vnd.kubernetes.protobuf"
	// Default cluster/context/auth name to be set in clientcmd config
	DefaultCmdConfigName = "kubernetes"
	// Header name that contains token used for authorization. See TokenManager for more information.
	JWETokenHeader = "jweToken"
	// Default http header for user-agent
	DefaultUserAgent = "dashboard"
)

Dashboard UI default values for client configs.

Variables

View Source
var Version = "UNKNOWN"

VERSION of this binary

Functions

This section is empty.

Types

type ClientManager added in v1.6.3

type ClientManager interface {
	Client(req *restful.Request) (kubernetes.Interface, error)
	InsecureClient() kubernetes.Interface
	Config(req *restful.Request) (*rest.Config, error)
	ClientCmdConfig(req *restful.Request) (clientcmd.ClientConfig, error)
	CSRFKey() string
	HasAccess(authInfo api.AuthInfo) error
	VerberClient(req *restful.Request) (ResourceVerber, error)
	SetTokenManager(manager authApi.TokenManager)
}

ClientManager is responsible for initializing and creating clients to communicate with kubernetes apiserver on demand

func NewClientManager added in v1.6.3

func NewClientManager(kubeConfigPath, apiserverHost string) ClientManager

NewClientManager creates client manager based on kubeConfigPath and apiserverHost parameters. If both are empty then in-cluster config is used.

type RESTClient added in v1.6.3

type RESTClient interface {
	Delete() *restclient.Request
	Put() *restclient.Request
	Get() *restclient.Request
}

RESTClient is an interface for REST operations used in this file.

type ResourceVerber added in v1.6.3

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

ResourceVerber is a struct responsible for doing common verb operations on resources, like DELETE, PUT, UPDATE.

func NewResourceVerber added in v1.6.3

func NewResourceVerber(client, extensionsClient, appsClient,
	batchClient, betaBatchClient, autoscalingClient, storageClient RESTClient) ResourceVerber

NewResourceVerber creates a new resource verber that uses the given client for performing operations.

func (*ResourceVerber) Delete added in v1.6.3

func (verber *ResourceVerber) Delete(kind string, namespaceSet bool, namespace string, name string) error

Delete deletes the resource of the given kind in the given namespace with the given name.

func (*ResourceVerber) Get added in v1.6.3

func (verber *ResourceVerber) Get(kind string, namespaceSet bool, namespace string, name string) (runtime.Object, error)

Get gets the resource of the given kind in the given namespace with the given name.

func (*ResourceVerber) Put added in v1.6.3

func (verber *ResourceVerber) Put(kind string, namespaceSet bool, namespace string, name string,
	object *runtime.Unknown) error

Put puts new resource version of the given kind in the given namespace with the given name.

Jump to

Keyboard shortcuts

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