Documentation ¶
Index ¶
- type ClusterService
- func (s *ClusterService) DeleteNode(ctx context.Context, nodeName string) error
- func (s *ClusterService) GetClusterInfo(ctx context.Context) (*k8s.ClusterInfo, error)
- func (s *ClusterService) GetNode(ctx context.Context, nodeName string) (*k8s.NodeInfo, error)
- func (s *ClusterService) ListNodes(ctx context.Context) ([]k8s.NodeInfo, error)
- 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) ListConfigMaps(namespace string) (*v1.ConfigMapList, 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(ctx context.Context, namespace string, ingress *networkingv1.Ingress) (*networkingv1.Ingress, error)
- func (s *IngressService) DeleteIngress(ctx context.Context, namespace, name string) error
- func (s *IngressService) GetIngress(ctx context.Context, namespace, name string) (*networkingv1.Ingress, error)
- func (s *IngressService) ListIngresses(ctx context.Context, 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(k8sClient *client.K8sClient) *ClusterService
NewClusterService creates a new ClusterService instance
func (*ClusterService) DeleteNode ¶
func (s *ClusterService) DeleteNode(ctx context.Context, nodeName string) error
DeleteNode deletes a node from the cluster
func (*ClusterService) GetClusterInfo ¶
func (s *ClusterService) GetClusterInfo(ctx context.Context) (*k8s.ClusterInfo, error)
GetClusterInfo retrieves general information about the Kubernetes cluster
type ConfigMapService ¶
type ConfigMapService struct {
// contains filtered or unexported fields
}
ConfigMapService 提供对 Kubernetes ConfigMap 资源的操作
func NewConfigMapService ¶
func NewConfigMapService(k8sClient *client.K8sClient) *ConfigMapService
NewConfigMapService 创建一个新的 ConfigMapService 实例
func (*ConfigMapService) CreateConfigMap ¶
func (s *ConfigMapService) CreateConfigMap(namespace string, configMap *v1.ConfigMap) (*v1.ConfigMap, error)
CreateConfigMap 创建一个新的 ConfigMap
func (*ConfigMapService) DeleteConfigMap ¶
func (s *ConfigMapService) DeleteConfigMap(namespace, name string) error
DeleteConfigMap 删除指定命名空间中的指定 ConfigMap
func (*ConfigMapService) ListConfigMaps ¶
func (s *ConfigMapService) ListConfigMaps(namespace string) (*v1.ConfigMapList, error)
func (*ConfigMapService) UpdateConfigMap ¶
func (s *ConfigMapService) UpdateConfigMap(namespace string, configMap *v1.ConfigMap) (*v1.ConfigMap, error)
UpdateConfigMap 更新指定的 ConfigMap
type DaemonSetService ¶
type DaemonSetService struct {
// contains filtered or unexported fields
}
DaemonSetService 提供对 Kubernetes DaemonSet 资源的操作
func NewDaemonSetService ¶
func NewDaemonSetService(client *client.K8sClient) *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.K8sClient) *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
}
IngressService provides methods for managing Kubernetes Ingresses
func NewIngressService ¶
func NewIngressService(client *client.K8sClient) *IngressService
NewIngressService creates a new instance of IngressService
func (*IngressService) CreateIngress ¶
func (s *IngressService) CreateIngress(ctx context.Context, namespace string, ingress *networkingv1.Ingress) (*networkingv1.Ingress, error)
CreateIngress creates a new ingress in a given namespace
func (*IngressService) DeleteIngress ¶
func (s *IngressService) DeleteIngress(ctx context.Context, namespace, name string) error
DeleteIngress deletes an ingress by name in a given namespace
func (*IngressService) GetIngress ¶
func (s *IngressService) GetIngress(ctx context.Context, namespace, name string) (*networkingv1.Ingress, error)
GetIngress retrieves a specific ingress by name in a given namespace
func (*IngressService) ListIngresses ¶
func (s *IngressService) ListIngresses(ctx context.Context, 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.K8sClient) *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 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.K8sClient) *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 ¶
type PVCService struct {
// contains filtered or unexported fields
}
PVCService 提供对 Kubernetes PersistentVolumeClaim 资源的操作
func NewPVCService ¶
func NewPVCService(k8sClient *client.K8sClient) *PVCService
NewPVCService 创建一个新的 PVCService 实例
func (*PVCService) CreatePVC ¶
func (s *PVCService) CreatePVC(namespace string, pvc *v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)
CreatePVC 创建一个新的 PersistentVolumeClaim
func (*PVCService) DeletePVC ¶
func (s *PVCService) DeletePVC(namespace, name string) error
DeletePVC 删除指定命名空间和名称的 PersistentVolumeClaim
func (*PVCService) GetPVC ¶
func (s *PVCService) GetPVC(namespace, name string) (*v1.PersistentVolumeClaim, error)
GetPVC 获取指定命名空间和名称的 PersistentVolumeClaim
func (*PVCService) UpdatePVC ¶
func (s *PVCService) UpdatePVC(namespace string, pvc *v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)
UpdatePVC 更新指定的 PersistentVolumeClaim
type PVService ¶
type PVService struct {
// contains filtered or unexported fields
}
PVService 提供对 Kubernetes PersistentVolume 资源的操作
func NewPVService ¶
NewPVService 创建一个新的 PVService 实例
func (*PVService) CreatePV ¶
func (s *PVService) CreatePV(pv *v1.PersistentVolume) (*v1.PersistentVolume, error)
CreatePV 创建一个新的 PersistentVolume
func (*PVService) GetPV ¶
func (s *PVService) GetPV(name string) (*v1.PersistentVolume, error)
GetPV 获取指定名称的 PersistentVolume
func (*PVService) UpdatePV ¶
func (s *PVService) UpdatePV(pv *v1.PersistentVolume) (*v1.PersistentVolume, error)
UpdatePV 更新指定的 PersistentVolume
type PodService ¶
type PodService struct {
// contains filtered or unexported fields
}
func NewPodService ¶
func NewPodService(c *client.K8sClient) *PodService
func (*PodService) DeletePod ¶
func (ps *PodService) DeletePod(namespace, podName string) error
type SecretService ¶
type SecretService struct {
// contains filtered or unexported fields
}
SecretService 提供对 Kubernetes Secret 资源的操作
func NewSecretService ¶
func NewSecretService(k8sClient *client.K8sClient) *SecretService
NewSecretService 创建一个新的 SecretService 实例
func (*SecretService) CreateSecret ¶
CreateSecret 创建一个新的 Secret
func (*SecretService) DeleteSecret ¶
func (s *SecretService) DeleteSecret(namespace, name string) error
DeleteSecret 删除指定命名空间和名称的 Secret
func (*SecretService) GetSecret ¶
func (s *SecretService) GetSecret(namespace, name string) (*v1.Secret, error)
GetSecret 获取指定命名空间和名称的 Secret
func (*SecretService) UpdateSecret ¶
UpdateSecret 更新指定的 Secret
type ServiceService ¶
type ServiceService struct {
// contains filtered or unexported fields
}
ServiceService 提供对 Kubernetes Service 资源的操作
func NewServiceService ¶
func NewServiceService(client *client.K8sClient) *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
}
StatefulSetService 提供对 Kubernetes StatefulSet 资源的操作
func NewStatefulSetService ¶
func NewStatefulSetService(client *client.K8sClient) *StatefulSetService
NewStatefulSetService 创建一个新的 StatefulSetService 实例
func (*StatefulSetService) CreateStatefulSet ¶
func (s *StatefulSetService) CreateStatefulSet(namespace string, statefulSet *appsv1.StatefulSet) (*k8s.StatefulSetModel, error)
CreateStatefulSet 创建一个新的 StatefulSet
func (*StatefulSetService) DeleteStatefulSet ¶
func (s *StatefulSetService) DeleteStatefulSet(namespace, name string) error
DeleteStatefulSet 删除指定命名空间中的指定 StatefulSet
func (*StatefulSetService) GetStatefulSet ¶
func (s *StatefulSetService) GetStatefulSet(namespace, name string) (*k8s.StatefulSetModel, error)
GetStatefulSet 获取指定命名空间中指定 StatefulSet 的详细信息
func (*StatefulSetService) ListStatefulSets ¶
func (s *StatefulSetService) ListStatefulSets(namespace string) ([]k8s.StatefulSetModel, error)
ListStatefulSets 列出指定命名空间中的所有 StatefulSets
func (*StatefulSetService) UpdateStatefulSet ¶
func (s *StatefulSetService) UpdateStatefulSet(namespace string, statefulSet *appsv1.StatefulSet) (*k8s.StatefulSetModel, error)
UpdateStatefulSet 更新指定命名空间中的 StatefulSet
type StorageClassService ¶
type StorageClassService struct {
// contains filtered or unexported fields
}
func NewStorageClassService ¶
func NewStorageClassService(client *client.K8sClient) *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)