Documentation ¶
Index ¶
- Constants
- type Container
- func (c *Container) ComponentOrAddonSearch(cluster, searchType, searchValue string) ([]apistructs.Resource, error)
- func (c *Container) ConvertToContainer(fields map[string]interface{}) *model.Container
- func (c *Container) Create(container *model.Container) error
- func (c *Container) CreateOrUpdateContainer(container *model.Container) error
- func (c *Container) GetContainerByTaskIDOrContainerID(cluster, taskID, containerID string) ([]model.Container, error)
- func (c *Container) GetRunningAddonByClusterAndAddon(clusterName, addonID string) ([]apistructs.ContainerFetchResponseData, error)
- func (c *Container) GetRunningComponentByClusterAndComponent(clusterName, component string) ([]apistructs.ContainerFetchResponseData, error)
- func (c *Container) ListAllByService(runtimeID, serviceName string) ([]apistructs.Container, error)
- func (c *Container) ListByApp(appID, orgID string, running bool) ([]apistructs.ContainerFetchResponseData, error)
- func (c *Container) ListByCluster(clusterName, orgID string, running bool) ([]apistructs.ContainerFetchResponseData, error)
- func (c *Container) ListByHost(clusterName, hostIP string, running bool) ([]apistructs.ContainerFetchResponseData, error)
- func (c *Container) ListByOrg(orgID string, running bool) ([]apistructs.ContainerFetchResponseData, error)
- func (c *Container) ListByProject(projectID, orgID string, running bool) ([]apistructs.ContainerFetchResponseData, error)
- func (c *Container) ListByRuntime(runtimeID, orgID string, running bool) ([]apistructs.ContainerFetchResponseData, error)
- func (c *Container) ListClusterServices(clusterName string) ([]apistructs.ServiceUsageData, error)
- func (c *Container) ListComponentUsageByCluster(clusterName string) ([]apistructs.ComponentUsageFetchResponseData, error)
- func (c *Container) ListEdasByParams(params *apistructs.EdasContainerListRequest) ([]apistructs.ContainerFetchResponseData, error)
- func (c *Container) ListRunningByClusterAndHost(clusterName, hostIP string) ([]apistructs.Container, error)
- func (c *Container) ListRunningByService(runtimeID, serviceName string) ([]apistructs.Container, error)
- func (c *Container) ListStoppedByService(runtimeID, serviceName string) ([]apistructs.Container, error)
- func (c *Container) SearchContainer(cluster, keyword, orgID string) ([]apistructs.Resource, error)
- func (c *Container) SearchService(clusterName, keyword, orgID string) ([]apistructs.Resource, error)
- func (c *Container) SyncContainerInfo(containers []*model.Container) error
- func (c *Container) Update(container *model.Container) error
- type ContainerList
- type Option
Constants ¶
const (
// EDAS edas集群
EDAS = "edas"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container 资源对象操作封装
func (*Container) ComponentOrAddonSearch ¶
func (c *Container) ComponentOrAddonSearch(cluster, searchType, searchValue string) ([]apistructs.Resource, error)
ComponentOrAddonSearch 按compoenent & addon 过滤 TODO 专为搜索使用,搜索API重构后可去除
func (*Container) ConvertToContainer ¶
ConvertToContainer 根据kafka推送的消息转换成contaienr对象
func (*Container) CreateOrUpdateContainer ¶
CreateOrUpdateContainer 创建或更新容器
func (*Container) GetContainerByTaskIDOrContainerID ¶
func (c *Container) GetContainerByTaskIDOrContainerID(cluster, taskID, containerID string) ([]model.Container, error)
GetContainerByTaskIDOrContainerID
func (*Container) GetRunningAddonByClusterAndAddon ¶
func (c *Container) GetRunningAddonByClusterAndAddon(clusterName, addonID string) ([]apistructs.ContainerFetchResponseData, error)
GetRunningAddonByClusterAndAddon 根据 clusterName 获取运行中 addon 容器列表
func (*Container) GetRunningComponentByClusterAndComponent ¶
func (c *Container) GetRunningComponentByClusterAndComponent(clusterName, component string) ([]apistructs.ContainerFetchResponseData, error)
GetRunningComponentByClusterAndComponent 根据 clusterName 获取运行中 component 容器列表
func (*Container) ListAllByService ¶
func (c *Container) ListAllByService(runtimeID, serviceName string) ([]apistructs.Container, error)
ListAllByService 根据serviceName 获取所有实例列表(包含运行中 & 已停止)
func (*Container) ListByApp ¶
func (c *Container) ListByApp(appID, orgID string, running bool) ([]apistructs.ContainerFetchResponseData, error)
ListByApp 根据 appID 获取容器列表
func (*Container) ListByCluster ¶
func (c *Container) ListByCluster(clusterName, orgID string, running bool) ([]apistructs.ContainerFetchResponseData, error)
ListByCluster 根据 clusterName 获取容器列表
func (*Container) ListByHost ¶
func (c *Container) ListByHost(clusterName, hostIP string, running bool) ([]apistructs.ContainerFetchResponseData, error)
ListByHost 根据 clusterName & hostIP 获取容器列表
func (*Container) ListByOrg ¶
func (c *Container) ListByOrg(orgID string, running bool) ([]apistructs.ContainerFetchResponseData, error)
ListByOrg 根据 orgID 获取容器列表
func (*Container) ListByProject ¶
func (c *Container) ListByProject(projectID, orgID string, running bool) ([]apistructs.ContainerFetchResponseData, error)
ListByProject 根据 projectID 获取容器列表
func (*Container) ListByRuntime ¶
func (c *Container) ListByRuntime(runtimeID, orgID string, running bool) ([]apistructs.ContainerFetchResponseData, error)
ListByRuntime 根据 runtimeID 获取容器列表
func (*Container) ListClusterServices ¶
func (c *Container) ListClusterServices(clusterName string) ([]apistructs.ServiceUsageData, error)
ListClusterServicesList 获取指定集群的所有service列表
func (*Container) ListComponentUsageByCluster ¶
func (c *Container) ListComponentUsageByCluster(clusterName string) ([]apistructs.ComponentUsageFetchResponseData, error)
ListComponentUsageByCluster 根据 clusterName 获取平台组件资源使用列表
func (*Container) ListEdasByParams ¶
func (c *Container) ListEdasByParams(params *apistructs.EdasContainerListRequest) ([]apistructs.ContainerFetchResponseData, error)
ListEdasByParams 根据 params 过滤出 EDAS 容器列表
func (*Container) ListRunningByClusterAndHost ¶
func (c *Container) ListRunningByClusterAndHost(clusterName, hostIP string) ([]apistructs.Container, error)
ListRunningByClusterAndHost 根据 cluster & hostIP 获取运行中容器列表
func (*Container) ListRunningByService ¶
func (c *Container) ListRunningByService(runtimeID, serviceName string) ([]apistructs.Container, error)
ListRunningByService 根据serviceName 获取运行中实例列表
func (*Container) ListStoppedByService ¶
func (c *Container) ListStoppedByService(runtimeID, serviceName string) ([]apistructs.Container, error)
ListStoppedByService 根据serviceName 获取已停止实例列表
func (*Container) SearchContainer ¶
func (c *Container) SearchContainer(cluster, keyword, orgID string) ([]apistructs.Resource, error)
SearchContainer 按容器过滤 TODO 搜索API重构后可去除
func (*Container) SearchService ¶
func (c *Container) SearchService(clusterName, keyword, orgID string) ([]apistructs.Resource, error)
SearchService 服务范围内搜索 TODO 专为搜索使用,搜索API重构后可去除
func (*Container) SyncContainerInfo ¶
SyncContainerInfo 容器全量事件同步
type ContainerList ¶
A slice of Container that implements sort.Interface to sort by Value.
func (ContainerList) Len ¶
func (cl ContainerList) Len() int
func (ContainerList) Less ¶
func (cl ContainerList) Less(i, j int) bool
func (ContainerList) Swap ¶
func (cl ContainerList) Swap(i, j int)