chClient

package
v3.0.1-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2018 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrUnableToLogin -- unable to login
	ErrUnableToLogin chkitErrors.Err = "unable to login"
	// ErrUnableToRefreshToken -- unable to refresh token
	ErrUnableToRefreshToken chkitErrors.Err = "unable to refresh token"
	// ErrWrongPasswordLoginCombination -- wrong login-password combination
	ErrWrongPasswordLoginCombination chkitErrors.Err = "wrong login-password combination"
	// ErrUserNotExist -- user doesn't not exist
	ErrUserNotExist  chkitErrors.Err = "user doesn't not exist"
	ErrInternalError chkitErrors.Err = "internal server error"
)
View Source
const (
	// ErrYouDoNotHaveAccessToNamespace -- you don't have access to namespace
	ErrYouDoNotHaveAccessToResource chkitErrors.Err = "you don't have access to resource"
	ErrResourceNotExists            chkitErrors.Err = "resource not exists"
	ErrFatalError                   chkitErrors.Err = "fatal error"
)
View Source
const (
	// ErrUnableToGetNamespace -- unable to get namespace
	ErrUnableToGetNamespace chkitErrors.Err = "unable to get namespace"
	// ErrYouDoNotHaveAccessToNamespace -- you don't have access to namespace
	ErrYouDoNotHaveAccessToNamespace chkitErrors.Err = "you don't have access to namespace"
	// ErrNamespaceNotExists -- namespace not exists
	ErrNamespaceNotExists chkitErrors.Err = "namespace not exists"
)
View Source
const (
	// ErrUnableToInitClient -- unable to init client
	ErrUnableToInitClient chkitErrors.Err = "unable to init client"
)

Variables

This section is empty.

Functions

func WithCommonAPI

func WithCommonAPI(config model.Config) (*kubeClient.Client, error)

WithCommonAPI -- creates kube-client for production api

func WithMock

func WithMock(config model.Config) (*kubeClient.Client, error)

WithMock -- creates kube-client with mock API

func WithTestAPI

func WithTestAPI(config model.Config) (*kubeClient.Client, error)

WithTestAPI -- creates kube-client for test api

Types

type Client

type Client struct {
	model.Config
	// contains filtered or unexported fields
}

Client -- chkit core client

func NewClient

func NewClient(config model.Config, option KubeAPIclientFactory) (*Client, error)

NewClient -- creates new client with provided options

func (*Client) Auth

func (client *Client) Auth() error

Auth -- refreshes tokens, on invalid token uses Login method to get new tokens

func (*Client) CreateDeployment

func (client *Client) CreateDeployment(ns string, depl deployment.Deployment) error

func (*Client) CreateService

func (client *Client) CreateService(ns string, serv service.Service) error

func (*Client) DeleteDeployment

func (client *Client) DeleteDeployment(namespace, deplName string) error

func (*Client) DeleteNamespace

func (client *Client) DeleteNamespace(namespace string) error

func (*Client) DeletePod

func (client *Client) DeletePod(namespace, pod string) error

func (*Client) DeleteService

func (client *Client) DeleteService(namespace, service string) error

func (*Client) Extend

func (client *Client) Extend() error

Extend -- refreshes tokens, invalidates old

func (*Client) GetDeployment

func (client *Client) GetDeployment(namespace, deplName string) (deployment.Deployment, error)

func (*Client) GetDeploymentList

func (client *Client) GetDeploymentList(namespace string) (deployment.DeploymentList, error)

func (*Client) GetNamespace

func (client *Client) GetNamespace(label string) (namespace.Namespace, error)

GetNamespace -- returns info of namespace with given label. Returns:

  • ErrNamespaceNotExists
  • ErrWrongPasswordLoginCombination
  • ErrUserNotExist

func (*Client) GetNamespaceList

func (client *Client) GetNamespaceList() (namespace.NamespaceList, error)

func (*Client) GetPod

func (client *Client) GetPod(ns, podname string) (pod.Pod, error)

func (*Client) GetPodList

func (client *Client) GetPodList(ns string) (pod.PodList, error)

func (*Client) GetPodLogs

func (client *Client) GetPodLogs(params client.GetPodLogsParams) (io.ReadCloser, error)

func (*Client) GetService

func (client *Client) GetService(namespace, serviceName string) (service.Service, error)

func (*Client) GetServiceList

func (client *Client) GetServiceList(namespace string) (service.ServiceList, error)

func (*Client) Login

func (client *Client) Login() error

Login -- client login method. Updates tokens

type GetPodLogsParams

type GetPodLogsParams = client.GetPodLogsParams

type KubeAPIclientFactory

type KubeAPIclientFactory func(model.Config) (*kubeClient.Client, error)

KubeAPIclientFactory -- creates new kube-client with provided config

Jump to

Keyboard shortcuts

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