Documentation ¶
Index ¶
- Variables
- func BuildApiserverClient()
- func Client(cluster string) (*kubernetes.Clientset, error)
- func Cluster(cluster string) (*models.Cluster, error)
- func Managers() *sync.Map
- type CacheFactory
- func (c *CacheFactory) DeploymentLister() appsv1.DeploymentLister
- func (c *CacheFactory) EndpointLister() corev1.EndpointsLister
- func (c *CacheFactory) EventLister() corev1.EventLister
- func (c *CacheFactory) HPALister() autoscalingv1.HorizontalPodAutoscalerLister
- func (c *CacheFactory) NodeLister() corev1.NodeLister
- func (c *CacheFactory) PodLister() corev1.PodLister
- type ClusterManager
- type ResourceHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotExist = errors.New("集群不存在。 ") ErrMaintaining = errors.New("集群正在维护,请稍后再试。 ") )
Functions ¶
func BuildApiserverClient ¶
func BuildApiserverClient()
Types ¶
type CacheFactory ¶
type CacheFactory struct {
// contains filtered or unexported fields
}
func (*CacheFactory) DeploymentLister ¶
func (c *CacheFactory) DeploymentLister() appsv1.DeploymentLister
func (*CacheFactory) EndpointLister ¶
func (c *CacheFactory) EndpointLister() corev1.EndpointsLister
func (*CacheFactory) EventLister ¶
func (c *CacheFactory) EventLister() corev1.EventLister
func (*CacheFactory) HPALister ¶
func (c *CacheFactory) HPALister() autoscalingv1.HorizontalPodAutoscalerLister
func (*CacheFactory) NodeLister ¶
func (c *CacheFactory) NodeLister() corev1.NodeLister
func (*CacheFactory) PodLister ¶
func (c *CacheFactory) PodLister() corev1.PodLister
type ClusterManager ¶
type ClusterManager struct { Cluster *models.Cluster Client *kubernetes.Clientset Config *rest.Config CacheFactory *CacheFactory KubeClient ResourceHandler DynamicClient *dynamic.DynamicClient CrdClient *apiextensionsclientset.Clientset }
func Manager ¶
func Manager(cluster string) (*ClusterManager, error)
func (ClusterManager) Close ¶
func (c ClusterManager) Close()
type ResourceHandler ¶
type ResourceHandler interface { Create(kind string, namespace string, object *runtime.Unknown) (*runtime.Unknown, error) Update(kind string, namespace string, name string, object *runtime.Unknown) (*runtime.Unknown, error) Get(kind string, namespace string, name string) (runtime.Object, error) List(kind string, namespace string, labelSelector string) ([]runtime.Object, error) Delete(kind string, namespace string, name string, options *metav1.DeleteOptions) error GVRK(resourceName string) (api.ResourceMap, error) }
定义了资源操作的标准方法,包括 Create、Update、Get、List 和 Delete 支持处理命名空间资源和全局资源。
func KubeClient ¶
func KubeClient(cluster string) (ResourceHandler, error)
func NewResourceHandler ¶
func NewResourceHandler(kubeClient *kubernetes.Clientset, dynamicClient *dynamic.DynamicClient, cacheFactory *CacheFactory) ResourceHandler
Click to show internal directories.
Click to hide internal directories.