Documentation ¶
Index ¶
- type ClusterService
- type ConfigMapService
- func (s *ConfigMapService) CreateConfigMap(namespace string, configMap *v1.ConfigMap) (*v1.ConfigMap, error)
- func (s *ConfigMapService) DeleteConfigMap(namespace, name string) error
- func (s *ConfigMapService) GetConfigMap(namespace, name string) (*v1.ConfigMap, error)
- func (s *ConfigMapService) UpdateConfigMap(namespace string, configMap *v1.ConfigMap) (*v1.ConfigMap, error)
- type DaemonSetService
- func (s *DaemonSetService) CreateDaemonSet(namespace string, daemonSet *appsv1.DaemonSet) (*k8s.DaemonSetModel, error)
- func (s *DaemonSetService) DeleteDaemonSet(namespace, name string) error
- func (s *DaemonSetService) GetDaemonSet(namespace, name string) (*k8s.DaemonSetModel, error)
- func (s *DaemonSetService) ListDaemonSets(namespace string) ([]k8s.DaemonSetModel, error)
- func (s *DaemonSetService) UpdateDaemonSet(namespace string, daemonSet *appsv1.DaemonSet) (*k8s.DaemonSetModel, error)
- type DeploymentService
- func (s *DeploymentService) CreateDeployment(ctx context.Context, deployment *k8s.Deployment) error
- func (s *DeploymentService) DeleteDeployment(ctx context.Context, namespace, name string) error
- func (s *DeploymentService) GetDeployment(ctx context.Context, namespace, name string) (*k8s.Deployment, error)
- func (s *DeploymentService) ListDeployments(ctx context.Context, namespace string) ([]k8s.Deployment, error)
- func (s *DeploymentService) UpdateDeployment(ctx context.Context, deployment *k8s.Deployment) error
- type IngressService
- func (s *IngressService) CreateIngress(namespace string, ingress *networkingv1.Ingress) (*networkingv1.Ingress, error)
- func (s *IngressService) DeleteIngress(namespace, name string) error
- func (s *IngressService) GetIngress(namespace, name string) (*networkingv1.Ingress, error)
- func (s *IngressService) ListIngresses(namespace string) ([]networkingv1.Ingress, error)
- type NamespaceService
- func (s *NamespaceService) CreateNamespace(name string, labels map[string]string) (*k8s.Namespace, error)
- func (s *NamespaceService) DeleteNamespace(name string) error
- func (s *NamespaceService) GetNamespace(name string) (*k8s.Namespace, error)
- func (s *NamespaceService) ListNamespaces() ([]*k8s.Namespace, error)
- type NodeService
- type PVCService
- func (s *PVCService) CreatePVC(namespace string, pvc *v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)
- func (s *PVCService) DeletePVC(namespace, name string) error
- func (s *PVCService) GetPVC(namespace, name string) (*v1.PersistentVolumeClaim, error)
- func (s *PVCService) UpdatePVC(namespace string, pvc *v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)
- type PVService
- type PodService
- type SecretService
- func (s *SecretService) CreateSecret(namespace string, secret *v1.Secret) (*v1.Secret, error)
- func (s *SecretService) DeleteSecret(namespace, name string) error
- func (s *SecretService) GetSecret(namespace, name string) (*v1.Secret, error)
- func (s *SecretService) UpdateSecret(namespace string, secret *v1.Secret) (*v1.Secret, error)
- type ServiceService
- func (s *ServiceService) CreateService(namespace string, service *v1.Service) (*k8s.ServiceModel, error)
- func (s *ServiceService) DeleteService(namespace, name string) error
- func (s *ServiceService) GetService(namespace, name string) (*k8s.ServiceModel, error)
- func (s *ServiceService) ListAllServices() ([]k8s.ServiceModel, error)
- func (s *ServiceService) ListServices(namespace string) ([]k8s.ServiceModel, error)
- type StatefulSetService
- func (s *StatefulSetService) CreateStatefulSet(namespace string, statefulSet *appsv1.StatefulSet) (*k8s.StatefulSetModel, error)
- func (s *StatefulSetService) DeleteStatefulSet(namespace, name string) error
- func (s *StatefulSetService) GetStatefulSet(namespace, name string) (*k8s.StatefulSetModel, error)
- func (s *StatefulSetService) ListStatefulSets(namespace string) ([]k8s.StatefulSetModel, error)
- func (s *StatefulSetService) UpdateStatefulSet(namespace string, statefulSet *appsv1.StatefulSet) (*k8s.StatefulSetModel, error)
- type StorageClassService
- func (s *StorageClassService) CreateStorageClass(sc *storagev1.StorageClass) (*storagev1.StorageClass, error)
- func (s *StorageClassService) DeleteStorageClass(name string) error
- func (s *StorageClassService) GetStorageClass(name string) (*storagev1.StorageClass, error)
- func (s *StorageClassService) UpdateStorageClass(sc *storagev1.StorageClass) (*storagev1.StorageClass, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterService ¶
type ClusterService struct {
// contains filtered or unexported fields
}
func NewClusterService ¶
func NewClusterService(clientset *kubernetes.Clientset) *ClusterService
func (*ClusterService) DeleteNode ¶
func (s *ClusterService) DeleteNode(nodeName string) error
DeleteNode deletes a node from the cluster
func (*ClusterService) GetClusterInfo ¶
func (s *ClusterService) GetClusterInfo() (*k8s.ClusterInfo, error)
GetClusterInfo retrieves general information about the Kubernetes cluster
type ConfigMapService ¶
func NewConfigMapService ¶
func NewConfigMapService(k8sClient *client.Client) *ConfigMapService
func (*ConfigMapService) CreateConfigMap ¶
func (*ConfigMapService) DeleteConfigMap ¶
func (s *ConfigMapService) DeleteConfigMap(namespace, name string) error
func (*ConfigMapService) GetConfigMap ¶
func (s *ConfigMapService) GetConfigMap(namespace, name string) (*v1.ConfigMap, error)
func (*ConfigMapService) UpdateConfigMap ¶
type DaemonSetService ¶
type DaemonSetService struct {
// contains filtered or unexported fields
}
DaemonSetService 提供对 Kubernetes DaemonSet 资源的操作
func NewDaemonSetService ¶
func NewDaemonSetService(client *client.Client) *DaemonSetService
NewDaemonSetService 创建一个新的 DaemonSetService 实例
func (*DaemonSetService) CreateDaemonSet ¶
func (s *DaemonSetService) CreateDaemonSet(namespace string, daemonSet *appsv1.DaemonSet) (*k8s.DaemonSetModel, error)
CreateDaemonSet 创建一个新的 DaemonSet
func (*DaemonSetService) DeleteDaemonSet ¶
func (s *DaemonSetService) DeleteDaemonSet(namespace, name string) error
DeleteDaemonSet 删除指定命名空间中的指定 DaemonSet
func (*DaemonSetService) GetDaemonSet ¶
func (s *DaemonSetService) GetDaemonSet(namespace, name string) (*k8s.DaemonSetModel, error)
GetDaemonSet 获取指定命名空间中指定 DaemonSet 的详细信息
func (*DaemonSetService) ListDaemonSets ¶
func (s *DaemonSetService) ListDaemonSets(namespace string) ([]k8s.DaemonSetModel, error)
ListDaemonSets 列出指定命名空间中的所有 DaemonSets
func (*DaemonSetService) UpdateDaemonSet ¶
func (s *DaemonSetService) UpdateDaemonSet(namespace string, daemonSet *appsv1.DaemonSet) (*k8s.DaemonSetModel, error)
UpdateDaemonSet 更新指定的 DaemonSet
type DeploymentService ¶
type DeploymentService struct {
// contains filtered or unexported fields
}
DeploymentService provides methods for interacting with Kubernetes Deployments
func NewDeploymentService ¶
func NewDeploymentService(k8sClient *client.Client) *DeploymentService
NewDeploymentService creates a new DeploymentService instance with a Kubernetes client
func (*DeploymentService) CreateDeployment ¶
func (s *DeploymentService) CreateDeployment(ctx context.Context, deployment *k8s.Deployment) error
CreateDeployment creates a new Deployment
func (*DeploymentService) DeleteDeployment ¶
func (s *DeploymentService) DeleteDeployment(ctx context.Context, namespace, name string) error
DeleteDeployment deletes a Deployment by name and namespace
func (*DeploymentService) GetDeployment ¶
func (s *DeploymentService) GetDeployment(ctx context.Context, namespace, name string) (*k8s.Deployment, error)
GetDeployment retrieves a single Deployment by name and namespace
func (*DeploymentService) ListDeployments ¶
func (s *DeploymentService) ListDeployments(ctx context.Context, namespace string) ([]k8s.Deployment, error)
ListDeployments retrieves a list of Deployments in the specified namespace
func (*DeploymentService) UpdateDeployment ¶
func (s *DeploymentService) UpdateDeployment(ctx context.Context, deployment *k8s.Deployment) error
UpdateDeployment updates an existing Deployment
type IngressService ¶
type IngressService struct {
// contains filtered or unexported fields
}
func NewIngressService ¶
func NewIngressService(clientset *kubernetes.Clientset) *IngressService
NewIngressService creates a new instance of IngressService
func (*IngressService) CreateIngress ¶
func (s *IngressService) CreateIngress(namespace string, ingress *networkingv1.Ingress) (*networkingv1.Ingress, error)
CreateIngress creates a new ingress in a given namespace
func (*IngressService) DeleteIngress ¶
func (s *IngressService) DeleteIngress(namespace, name string) error
DeleteIngress deletes an ingress by name in a given namespace
func (*IngressService) GetIngress ¶
func (s *IngressService) GetIngress(namespace, name string) (*networkingv1.Ingress, error)
GetIngress retrieves a specific ingress by name in a given namespace
func (*IngressService) ListIngresses ¶
func (s *IngressService) ListIngresses(namespace string) ([]networkingv1.Ingress, error)
ListIngresses lists all ingresses in a given namespace
type NamespaceService ¶
type NamespaceService struct {
// contains filtered or unexported fields
}
NamespaceService provides methods for managing Kubernetes Namespaces
func NewNamespaceService ¶
func NewNamespaceService(client *client.Client) *NamespaceService
NewNamespaceService creates a new NamespaceService
func (*NamespaceService) CreateNamespace ¶
func (s *NamespaceService) CreateNamespace(name string, labels map[string]string) (*k8s.Namespace, error)
CreateNamespace creates a new Namespace
func (*NamespaceService) DeleteNamespace ¶
func (s *NamespaceService) DeleteNamespace(name string) error
DeleteNamespace deletes an existing Namespace by name
func (*NamespaceService) GetNamespace ¶
func (s *NamespaceService) GetNamespace(name string) (*k8s.Namespace, error)
GetNamespace retrieves a single Namespace by name
func (*NamespaceService) ListNamespaces ¶
func (s *NamespaceService) ListNamespaces() ([]*k8s.Namespace, error)
ListNamespaces retrieves a list of Namespaces
type NodeService ¶
type NodeService struct {
// contains filtered or unexported fields
}
func NewNodeService ¶
func NewNodeService(client *client.Client) *NodeService
NewNodeService creates a new NodeService
func (*NodeService) CreateNode ¶
CreateNode creates a new Node
func (*NodeService) DeleteNode ¶
func (s *NodeService) DeleteNode(name string) error
DeleteNode deletes a Node by name
type PVCService ¶
func NewPVCService ¶
func NewPVCService(k8sClient *client.Client) *PVCService
func (*PVCService) CreatePVC ¶
func (s *PVCService) CreatePVC(namespace string, pvc *v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)
func (*PVCService) DeletePVC ¶
func (s *PVCService) DeletePVC(namespace, name string) error
func (*PVCService) GetPVC ¶
func (s *PVCService) GetPVC(namespace, name string) (*v1.PersistentVolumeClaim, error)
func (*PVCService) UpdatePVC ¶
func (s *PVCService) UpdatePVC(namespace string, pvc *v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)
type PVService ¶
func NewPVService ¶
func (*PVService) CreatePV ¶
func (s *PVService) CreatePV(pv *v1.PersistentVolume) (*v1.PersistentVolume, error)
func (*PVService) UpdatePV ¶
func (s *PVService) UpdatePV(pv *v1.PersistentVolume) (*v1.PersistentVolume, error)
type PodService ¶
type PodService struct {
// contains filtered or unexported fields
}
func NewPodService ¶
func NewPodService(c *client.Client) *PodService
func (*PodService) DeletePod ¶
func (ps *PodService) DeletePod(namespace, podName string) error
type SecretService ¶
func NewSecretService ¶
func NewSecretService(k8sClient *client.Client) *SecretService
func (*SecretService) CreateSecret ¶
func (*SecretService) DeleteSecret ¶
func (s *SecretService) DeleteSecret(namespace, name string) error
func (*SecretService) GetSecret ¶
func (s *SecretService) GetSecret(namespace, name string) (*v1.Secret, error)
func (*SecretService) UpdateSecret ¶
type ServiceService ¶
type ServiceService struct {
// contains filtered or unexported fields
}
ServiceService 提供对 Kubernetes Service 资源的操作
func NewServiceService ¶
func NewServiceService(client *client.Client) *ServiceService
NewServiceService 创建一个新的 ServiceService 实例
func (*ServiceService) CreateService ¶
func (s *ServiceService) CreateService(namespace string, service *v1.Service) (*k8s.ServiceModel, error)
CreateService 创建一个新的 Service
func (*ServiceService) DeleteService ¶
func (s *ServiceService) DeleteService(namespace, name string) error
DeleteService 删除指定命名空间中的指定 Service
func (*ServiceService) GetService ¶
func (s *ServiceService) GetService(namespace, name string) (*k8s.ServiceModel, error)
GetService 获取指定命名空间中指定 Service 的详细信息
func (*ServiceService) ListAllServices ¶
func (s *ServiceService) ListAllServices() ([]k8s.ServiceModel, error)
ListAllServices 列出所有命名空间中的所有 Services
func (*ServiceService) ListServices ¶
func (s *ServiceService) ListServices(namespace string) ([]k8s.ServiceModel, error)
ListServices 列出指定命名空间中的所有 Services
type StatefulSetService ¶
type StatefulSetService struct {
// contains filtered or unexported fields
}
func NewStatefulSetService ¶
func NewStatefulSetService(client *client.Client) *StatefulSetService
func (*StatefulSetService) CreateStatefulSet ¶
func (s *StatefulSetService) CreateStatefulSet(namespace string, statefulSet *appsv1.StatefulSet) (*k8s.StatefulSetModel, error)
func (*StatefulSetService) DeleteStatefulSet ¶
func (s *StatefulSetService) DeleteStatefulSet(namespace, name string) error
func (*StatefulSetService) GetStatefulSet ¶
func (s *StatefulSetService) GetStatefulSet(namespace, name string) (*k8s.StatefulSetModel, error)
func (*StatefulSetService) ListStatefulSets ¶
func (s *StatefulSetService) ListStatefulSets(namespace string) ([]k8s.StatefulSetModel, error)
func (*StatefulSetService) UpdateStatefulSet ¶
func (s *StatefulSetService) UpdateStatefulSet(namespace string, statefulSet *appsv1.StatefulSet) (*k8s.StatefulSetModel, error)
type StorageClassService ¶
func NewStorageClassService ¶
func NewStorageClassService(k8sClient *client.Client) *StorageClassService
func (*StorageClassService) CreateStorageClass ¶
func (s *StorageClassService) CreateStorageClass(sc *storagev1.StorageClass) (*storagev1.StorageClass, error)
func (*StorageClassService) DeleteStorageClass ¶
func (s *StorageClassService) DeleteStorageClass(name string) error
func (*StorageClassService) GetStorageClass ¶
func (s *StorageClassService) GetStorageClass(name string) (*storagev1.StorageClass, error)
func (*StorageClassService) UpdateStorageClass ¶
func (s *StorageClassService) UpdateStorageClass(sc *storagev1.StorageClass) (*storagev1.StorageClass, error)