client

package
v0.0.0-...-a541f19 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

A client for the Kubernetes cluster management API There are three fundamental objects

Task - A single running container
TaskForce - A set of co-scheduled Task(s)
ReplicationController - A manager for replicating TaskForces

Copyright 2014 Google Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeLabelQuery

func DecodeLabelQuery(labelQuery string) map[string]string

func EncodeLabelQuery

func EncodeLabelQuery(labelQuery map[string]string) string

Types

type AuthInfo

type AuthInfo struct {
	User     string
	Password string
}

AuthInfo is used to store authorization information

type Client

type Client struct {
	Host string
	Auth *AuthInfo
	// contains filtered or unexported fields
}

Client is the actual implementation of a Kubernetes client. Host is the http://... base for the URL

func (Client) CreateReplicationController

func (client Client) CreateReplicationController(controller api.ReplicationController) (api.ReplicationController, error)

CreateReplicationController creates a new replication controller

func (Client) CreateService

func (client Client) CreateService(svc api.Service) (api.Service, error)

CreateReplicationController creates a new replication controller

func (Client) CreateTask

func (client Client) CreateTask(task api.Task) (api.Task, error)

CreateTask takes the representation of a task. Returns the server's representation of the task, and an error, if it occurs

func (Client) DeleteReplicationController

func (client Client) DeleteReplicationController(name string) error

func (Client) DeleteService

func (client Client) DeleteService(name string) error

func (Client) DeleteTask

func (client Client) DeleteTask(name string) error

DeleteTask takes the name of the task, and returns an error if one occurs

func (Client) GetReplicationController

func (client Client) GetReplicationController(name string) (api.ReplicationController, error)

GetReplicationController returns information about a particular replication controller

func (Client) GetService

func (client Client) GetService(name string) (api.Service, error)

GetReplicationController returns information about a particular replication controller

func (Client) GetTask

func (client Client) GetTask(name string) (api.Task, error)

GetTask takes the name of the task, and returns the corresponding Task object, and an error if it occurs

func (Client) ListTasks

func (client Client) ListTasks(labelQuery map[string]string) (api.TaskList, error)

ListTasks takes a label query, and returns the list of tasks that match that query

func (Client) UpdateReplicationController

func (client Client) UpdateReplicationController(controller api.ReplicationController) (api.ReplicationController, error)

UpdateReplicationController updates an existing replication controller

func (Client) UpdateService

func (client Client) UpdateService(svc api.Service) (api.Service, error)

UpdateReplicationController updates an existing replication controller

func (Client) UpdateTask

func (client Client) UpdateTask(task api.Task) (api.Task, error)

UpdateTask takes the representation of a task to update. Returns the server's representation of the task, and an error, if it occurs

type ClientInterface

type ClientInterface interface {
	ListTasks(labelQuery map[string]string) (api.TaskList, error)
	GetTask(name string) (api.Task, error)
	DeleteTask(name string) error
	CreateTask(api.Task) (api.Task, error)
	UpdateTask(api.Task) (api.Task, error)

	GetReplicationController(name string) (api.ReplicationController, error)
	CreateReplicationController(api.ReplicationController) (api.ReplicationController, error)
	UpdateReplicationController(api.ReplicationController) (api.ReplicationController, error)
	DeleteReplicationController(string) error

	GetService(name string) (api.Service, error)
	CreateService(api.Service) (api.Service, error)
	UpdateService(api.Service) (api.Service, error)
	DeleteService(string) error
}

ClientInterface holds the methods for clients of Kubenetes, an interface to allow mock testing

type ContainerInfo

type ContainerInfo interface {
	GetContainerInfo(host, name string) (interface{}, error)
}

type FakeContainerInfo

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

Useful for testing.

func (*FakeContainerInfo) GetContainerInfo

func (c *FakeContainerInfo) GetContainerInfo(host, name string) (interface{}, error)

type HTTPContainerInfo

type HTTPContainerInfo struct {
	Client *http.Client
	Port   uint
}

func (*HTTPContainerInfo) GetContainerInfo

func (c *HTTPContainerInfo) GetContainerInfo(host, name string) (interface{}, error)

Jump to

Keyboard shortcuts

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