Documentation ¶
Index ¶
- Constants
- func WithCommonAPI(config model.Config) (*kubeClient.Client, error)
- func WithMock(config model.Config) (*kubeClient.Client, error)
- func WithTestAPI(config model.Config) (*kubeClient.Client, error)
- type Client
- func (client *Client) Auth() error
- func (client *Client) CreateDeployment(ns string, depl deployment.Deployment) error
- func (client *Client) CreateService(ns string, serv service.Service) error
- func (client *Client) DeleteDeployment(namespace, deplName string) error
- func (client *Client) DeleteNamespace(namespace string) error
- func (client *Client) DeletePod(namespace, pod string) error
- func (client *Client) DeleteService(namespace, service string) error
- func (client *Client) Extend() error
- func (client *Client) GetDeployment(namespace, deplName string) (deployment.Deployment, error)
- func (client *Client) GetDeploymentList(namespace string) (deployment.DeploymentList, error)
- func (client *Client) GetNamespace(label string) (namespace.Namespace, error)
- func (client *Client) GetNamespaceList() (namespace.NamespaceList, error)
- func (client *Client) GetPod(ns, podname string) (pod.Pod, error)
- func (client *Client) GetPodList(ns string) (pod.PodList, error)
- func (client *Client) GetPodLogs(params client.GetPodLogsParams) (io.ReadCloser, error)
- func (client *Client) GetService(namespace, serviceName string) (service.Service, error)
- func (client *Client) GetServiceList(namespace string) (service.ServiceList, error)
- func (client *Client) Login() error
- type GetPodLogsParams
- type KubeAPIclientFactory
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 ¶
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 ¶
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) DeleteDeployment ¶
func (*Client) DeleteNamespace ¶
func (*Client) DeleteService ¶
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 ¶
GetNamespace -- returns info of namespace with given label. Returns:
- ErrNamespaceNotExists
- ErrWrongPasswordLoginCombination
- ErrUserNotExist
func (*Client) GetNamespaceList ¶
func (client *Client) GetNamespaceList() (namespace.NamespaceList, error)
func (*Client) GetPodLogs ¶
func (client *Client) GetPodLogs(params client.GetPodLogsParams) (io.ReadCloser, error)
func (*Client) GetService ¶
func (*Client) GetServiceList ¶
func (client *Client) GetServiceList(namespace string) (service.ServiceList, error)
type GetPodLogsParams ¶
type GetPodLogsParams = client.GetPodLogsParams
type KubeAPIclientFactory ¶
type KubeAPIclientFactory func(model.Config) (*kubeClient.Client, error)
KubeAPIclientFactory -- creates new kube-client with provided config
Click to show internal directories.
Click to hide internal directories.