Documentation ¶
Index ¶
- Constants
- type AddonPrebuild
- type Client
- func (c *Client) CreateHPAEventInfo(hpaEvent dbclient.HPAEventInfo) error
- func (c *Client) CreateVPARecommendation(vpaRecommendation dbclient.RuntimeVPAContainerRecommendation) error
- func (c *Client) DeletedOldVPARecommendations(interval int) error
- func (c *Client) GetLatestVPARecommendation(runtimeId uint64, ruleId, serviceName, containerName string) (dbclient.RuntimeVPAContainerRecommendation, error)
- func (c *Client) GetRuntimeID(instanceID string) (string, error)
- func (c *Client) InstanceReader() *InstanceReader
- func (c *Client) InstanceWriter() *instanceWriter
- func (c *Client) PodReader() *PodReader
- func (c *Client) PodWriter() *podWriter
- func (c *Client) ServiceReader() *ServiceReader
- func (c *Client) ServiceWriter() *serviceWriter
- func (c *Client) UpdateClusterInfo(clusterName, clusterInfo string) error
- type ClusterInfo
- type InstanceInfo
- type InstancePhase
- type InstanceReader
- func (r *InstanceReader) ByAddonID(id string) *InstanceReader
- func (r *InstanceReader) ByApplicationID(id string) *InstanceReader
- func (r *InstanceReader) ByApplicationName(name string) *InstanceReader
- func (r *InstanceReader) ByCluster(clustername string) *InstanceReader
- func (r *InstanceReader) ByContainerID(id string) *InstanceReader
- func (r *InstanceReader) ByEdgeApplicationName(name string) *InstanceReader
- func (r *InstanceReader) ByEdgeSite(name string) *InstanceReader
- func (r *InstanceReader) ByFinishedTime(beforeNday int) *InstanceReader
- func (r *InstanceReader) ByHostIP(ips ...string) *InstanceReader
- func (r *InstanceReader) ByInstanceIP(ips ...string) *InstanceReader
- func (r *InstanceReader) ByMetaLike(s string) *InstanceReader
- func (r *InstanceReader) ByName(name string) *InstanceReader
- func (r *InstanceReader) ByNamespace(ns string) *InstanceReader
- func (r *InstanceReader) ByNotTaskID(id string) *InstanceReader
- func (r *InstanceReader) ByOrgID(id string) *InstanceReader
- func (r *InstanceReader) ByOrgName(name string) *InstanceReader
- func (r *InstanceReader) ByPhase(phase string) *InstanceReader
- func (r *InstanceReader) ByPhases(phases ...string) *InstanceReader
- func (r *InstanceReader) ByProjectID(id string) *InstanceReader
- func (r *InstanceReader) ByProjectName(name string) *InstanceReader
- func (r *InstanceReader) ByRuntimeID(id string) *InstanceReader
- func (r *InstanceReader) ByRuntimeName(name string) *InstanceReader
- func (r *InstanceReader) ByService(name string) *InstanceReader
- func (r *InstanceReader) ByServiceType(tp string) *InstanceReader
- func (r *InstanceReader) ByTaskID(id string) *InstanceReader
- func (r *InstanceReader) ByUpdatedTime(beforeNSecs int) *InstanceReader
- func (r *InstanceReader) ByWorkspace(ws string) *InstanceReader
- func (r *InstanceReader) Do() ([]InstanceInfo, error)
- func (r *InstanceReader) Limit(n int) *InstanceReader
- type PodInfo
- type PodPhase
- type PodReader
- func (r *PodReader) ByAddonID(id string) *PodReader
- func (r *PodReader) ByApplicationID(id string) *PodReader
- func (r *PodReader) ByApplicationName(name string) *PodReader
- func (r *PodReader) ByCluster(clustername string) *PodReader
- func (r *PodReader) ByK8SNamespace(namespace string) *PodReader
- func (r *PodReader) ByName(name string) *PodReader
- func (r *PodReader) ByNamespace(ns string) *PodReader
- func (r *PodReader) ByOrgID(id string) *PodReader
- func (r *PodReader) ByOrgName(name string) *PodReader
- func (r *PodReader) ByPhase(phase string) *PodReader
- func (r *PodReader) ByPhases(phases ...string) *PodReader
- func (r *PodReader) ByPodName(podname string) *PodReader
- func (r *PodReader) ByProjectID(id string) *PodReader
- func (r *PodReader) ByProjectName(name string) *PodReader
- func (r *PodReader) ByRuntimeID(id string) *PodReader
- func (r *PodReader) ByRuntimeName(name string) *PodReader
- func (r *PodReader) ByService(name string) *PodReader
- func (r *PodReader) ByServiceType(tp string) *PodReader
- func (r *PodReader) ByUid(uid string) *PodReader
- func (r *PodReader) ByUpdatedTime(beforeNSecs int) *PodReader
- func (r *PodReader) ByWorkspace(ws string) *PodReader
- func (r *PodReader) Do() ([]PodInfo, error)
- func (r *PodReader) Limit(n int) *PodReader
- type ServiceInfo
- type ServicePhase
- type ServiceReader
- func (r *ServiceReader) ByApplicationID(id string) *ServiceReader
- func (r *ServiceReader) ByApplicationName(name string) *ServiceReader
- func (r *ServiceReader) ByName(name string) *ServiceReader
- func (r *ServiceReader) ByNamespace(ns string) *ServiceReader
- func (r *ServiceReader) ByOrgID(id string) *ServiceReader
- func (r *ServiceReader) ByOrgName(name string) *ServiceReader
- func (r *ServiceReader) ByProjectID(id string) *ServiceReader
- func (r *ServiceReader) ByProjectName(name string) *ServiceReader
- func (r *ServiceReader) ByRuntimeID(id string) *ServiceReader
- func (r *ServiceReader) ByRuntimeName(name string) *ServiceReader
- func (r *ServiceReader) ByService(name string) *ServiceReader
- func (r *ServiceReader) ByServiceType(tp string) *ServiceReader
- func (r *ServiceReader) ByWorkspace(ws string) *ServiceReader
- func (r *ServiceReader) Do() ([]ServiceInfo, error)
Constants ¶
View Source
const ( ServicePhaseHealthy = "Healthy" ServicePhaseUnHealthy = "UnHealthy" InstancePhaseRunning = "Running" InstancePhaseHealthy = "Healthy" InstancePhaseUnHealthy = "UnHealthy" InstancePhaseDead = "Dead" PodPhasePending = "Pending" PodPhaseRunning = "Running" PodPhaseSucceeded = "Succeeded" PodPhaseFailed = "Failed" PodPhaseUnknown = "Unknown" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddonPrebuild ¶
type AddonPrebuild struct { ID uint64 `gorm:"primary_key"` ApplicationID string `gorm:"type:varchar(32)"` GitBranch string `gorm:"type:varchar(128)"` Env string `gorm:"type:varchar(10)"` RuntimeID string `gorm:"type:varchar(32)"` RoutingInstanceID string `gorm:"type:varchar(64)"` InstanceID string `gorm:"type:varchar(64)"` InstanceName string `gorm:"type:varchar(128)"` AddonName string `gorm:"type:varchar(128)"` Plan string `gorm:"column:addon_class;type:varchar(64)"` Options string `gorm:"type:varchar(1024)"` Config string `gorm:"type:varchar(1024)"` BuildFrom int `gorm:"type:int(1);default:0"` // 0: dice.yml 来源 1: 重新分析 DeleteStatus int `gorm:"type:int(1),column:delete_status"` // 0: 未删除,1: diceyml删除,2: 重新分析删除 Deleted string `gorm:"column:is_deleted"` CreatedAt time.Time `gorm:"column:create_time"` UpdatedAt time.Time `gorm:"column:update_time"` }
func (AddonPrebuild) TableName ¶
func (AddonPrebuild) TableName() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateHPAEventInfo ¶
func (c *Client) CreateHPAEventInfo(hpaEvent dbclient.HPAEventInfo) error
func (*Client) CreateVPARecommendation ¶
func (c *Client) CreateVPARecommendation(vpaRecommendation dbclient.RuntimeVPAContainerRecommendation) error
func (*Client) DeletedOldVPARecommendations ¶
func (*Client) GetLatestVPARecommendation ¶
func (*Client) InstanceReader ¶
func (c *Client) InstanceReader() *InstanceReader
func (*Client) InstanceWriter ¶
func (c *Client) InstanceWriter() *instanceWriter
func (*Client) ServiceReader ¶
func (c *Client) ServiceReader() *ServiceReader
func (*Client) ServiceWriter ¶
func (c *Client) ServiceWriter() *serviceWriter
func (*Client) UpdateClusterInfo ¶
type ClusterInfo ¶
type ClusterInfo struct { ClusterName string `gorm:"column:name"` ClusterInfo string `gorm:"column:cluster_info"` }
func (ClusterInfo) TableName ¶
func (ClusterInfo) TableName() string
type InstanceInfo ¶
type InstanceInfo struct { dbengine.BaseModel Cluster string `gorm:"type:varchar(64);index"` Namespace string `gorm:"type:varchar(64);index"` Name string `gorm:"type:varchar(64);index"` // Information obtained from env OrgName string `gorm:"type:varchar(64);index"` OrgID string `gorm:"type:varchar(64);index"` ProjectName string `gorm:"type:varchar(64);index"` ProjectID string `gorm:"type:varchar(64);index"` ApplicationName string EdgeApplicationName string EdgeSite string ApplicationID string RuntimeName string RuntimeID string ServiceName string Workspace string `gorm:"type:varchar(10)"` // addon, stateless-service ServiceType string `gorm:"type:varchar(64)"` AddonID string Meta string // If it is k8s, the value is "k8s" TaskID string `gorm:"type:varchar(150);index"` Phase InstancePhase Message string ContainerID string `gorm:"type:varchar(100);index"` ContainerIP string HostIP string StartedAt time.Time FinishedAt *time.Time ExitCode int CpuOrigin float64 MemOrigin int CpuRequest float64 MemRequest int CpuLimit float64 MemLimit int Image string }
func (InstanceInfo) TableName ¶
func (InstanceInfo) TableName() string
type InstancePhase ¶
type InstancePhase string
type InstanceReader ¶
type InstanceReader struct {
// contains filtered or unexported fields
}
func (*InstanceReader) ByAddonID ¶
func (r *InstanceReader) ByAddonID(id string) *InstanceReader
func (*InstanceReader) ByApplicationID ¶
func (r *InstanceReader) ByApplicationID(id string) *InstanceReader
func (*InstanceReader) ByApplicationName ¶
func (r *InstanceReader) ByApplicationName(name string) *InstanceReader
func (*InstanceReader) ByCluster ¶
func (r *InstanceReader) ByCluster(clustername string) *InstanceReader
func (*InstanceReader) ByContainerID ¶
func (r *InstanceReader) ByContainerID(id string) *InstanceReader
func (*InstanceReader) ByEdgeApplicationName ¶
func (r *InstanceReader) ByEdgeApplicationName(name string) *InstanceReader
func (*InstanceReader) ByEdgeSite ¶
func (r *InstanceReader) ByEdgeSite(name string) *InstanceReader
func (*InstanceReader) ByFinishedTime ¶
func (r *InstanceReader) ByFinishedTime(beforeNday int) *InstanceReader
func (*InstanceReader) ByHostIP ¶
func (r *InstanceReader) ByHostIP(ips ...string) *InstanceReader
func (*InstanceReader) ByInstanceIP ¶
func (r *InstanceReader) ByInstanceIP(ips ...string) *InstanceReader
func (*InstanceReader) ByMetaLike ¶
func (r *InstanceReader) ByMetaLike(s string) *InstanceReader
func (*InstanceReader) ByName ¶
func (r *InstanceReader) ByName(name string) *InstanceReader
func (*InstanceReader) ByNamespace ¶
func (r *InstanceReader) ByNamespace(ns string) *InstanceReader
func (*InstanceReader) ByNotTaskID ¶
func (r *InstanceReader) ByNotTaskID(id string) *InstanceReader
func (*InstanceReader) ByOrgID ¶
func (r *InstanceReader) ByOrgID(id string) *InstanceReader
func (*InstanceReader) ByOrgName ¶
func (r *InstanceReader) ByOrgName(name string) *InstanceReader
func (*InstanceReader) ByPhase ¶
func (r *InstanceReader) ByPhase(phase string) *InstanceReader
func (*InstanceReader) ByPhases ¶
func (r *InstanceReader) ByPhases(phases ...string) *InstanceReader
func (*InstanceReader) ByProjectID ¶
func (r *InstanceReader) ByProjectID(id string) *InstanceReader
func (*InstanceReader) ByProjectName ¶
func (r *InstanceReader) ByProjectName(name string) *InstanceReader
func (*InstanceReader) ByRuntimeID ¶
func (r *InstanceReader) ByRuntimeID(id string) *InstanceReader
func (*InstanceReader) ByRuntimeName ¶
func (r *InstanceReader) ByRuntimeName(name string) *InstanceReader
func (*InstanceReader) ByService ¶
func (r *InstanceReader) ByService(name string) *InstanceReader
func (*InstanceReader) ByServiceType ¶
func (r *InstanceReader) ByServiceType(tp string) *InstanceReader
func (*InstanceReader) ByTaskID ¶
func (r *InstanceReader) ByTaskID(id string) *InstanceReader
func (*InstanceReader) ByUpdatedTime ¶
func (r *InstanceReader) ByUpdatedTime(beforeNSecs int) *InstanceReader
func (*InstanceReader) ByWorkspace ¶
func (r *InstanceReader) ByWorkspace(ws string) *InstanceReader
func (*InstanceReader) Do ¶
func (r *InstanceReader) Do() ([]InstanceInfo, error)
func (*InstanceReader) Limit ¶
func (r *InstanceReader) Limit(n int) *InstanceReader
type PodInfo ¶
type PodInfo struct { dbengine.BaseModel Cluster string `gorm:"type:varchar(64);index"` Namespace string `gorm:"type:varchar(64);index"` Name string `gorm:"type:varchar(64);index"` // Information obtained from env OrgName string `gorm:"type:varchar(64);index"` OrgID string `gorm:"type:varchar(64);index"` ProjectName string `gorm:"type:varchar(64);index"` ProjectID string `gorm:"type:varchar(64);index"` ApplicationName string ApplicationID string RuntimeName string RuntimeID string ServiceName string Workspace string `gorm:"type:varchar(10)"` // addon, stateless-service ServiceType string `gorm:"type:varchar(64)"` AddonID string Uid string `gorm:"index"` K8sNamespace string `gorm:"index"` PodName string `gorm:"index"` Phase PodPhase Message string PodIP string HostIP string StartedAt *time.Time MemRequest int MemLimit int CpuRequest float64 CpuLimit float64 }
type PodReader ¶
type PodReader struct {
// contains filtered or unexported fields
}
func (*PodReader) ByApplicationID ¶
func (*PodReader) ByApplicationName ¶
func (*PodReader) ByK8SNamespace ¶
func (*PodReader) ByNamespace ¶
func (*PodReader) ByProjectID ¶
func (*PodReader) ByProjectName ¶
func (*PodReader) ByRuntimeID ¶
func (*PodReader) ByRuntimeName ¶
func (*PodReader) ByServiceType ¶
func (*PodReader) ByUpdatedTime ¶
func (*PodReader) ByWorkspace ¶
type ServiceInfo ¶
type ServiceInfo struct { dbengine.BaseModel Cluster string Namespace string `gorm:"type:varchar(64);index"` Name string `gorm:"type:varchar(64);index"` // Information obtained from env OrgName string `gorm:"type:varchar(64);index"` OrgID string `gorm:"type:varchar(64);index"` ProjectName string `gorm:"type:varchar(64);index"` ProjectID string `gorm:"type:varchar(64);index"` ApplicationName string ApplicationID string RuntimeName string RuntimeID string ServiceName string Workspace string `gorm:"type:varchar(10)"` // addon, stateless-service ServiceType string `gorm:"type:varchar(64)"` Meta string Phase ServicePhase Message string StartedAt time.Time FinishedAt *time.Time }
func (ServiceInfo) TableName ¶
func (ServiceInfo) TableName() string
type ServicePhase ¶
type ServicePhase string
type ServiceReader ¶
type ServiceReader struct {
// contains filtered or unexported fields
}
func (*ServiceReader) ByApplicationID ¶
func (r *ServiceReader) ByApplicationID(id string) *ServiceReader
func (*ServiceReader) ByApplicationName ¶
func (r *ServiceReader) ByApplicationName(name string) *ServiceReader
func (*ServiceReader) ByName ¶
func (r *ServiceReader) ByName(name string) *ServiceReader
func (*ServiceReader) ByNamespace ¶
func (r *ServiceReader) ByNamespace(ns string) *ServiceReader
func (*ServiceReader) ByOrgID ¶
func (r *ServiceReader) ByOrgID(id string) *ServiceReader
func (*ServiceReader) ByOrgName ¶
func (r *ServiceReader) ByOrgName(name string) *ServiceReader
func (*ServiceReader) ByProjectID ¶
func (r *ServiceReader) ByProjectID(id string) *ServiceReader
func (*ServiceReader) ByProjectName ¶
func (r *ServiceReader) ByProjectName(name string) *ServiceReader
func (*ServiceReader) ByRuntimeID ¶
func (r *ServiceReader) ByRuntimeID(id string) *ServiceReader
func (*ServiceReader) ByRuntimeName ¶
func (r *ServiceReader) ByRuntimeName(name string) *ServiceReader
func (*ServiceReader) ByService ¶
func (r *ServiceReader) ByService(name string) *ServiceReader
func (*ServiceReader) ByServiceType ¶
func (r *ServiceReader) ByServiceType(tp string) *ServiceReader
func (*ServiceReader) ByWorkspace ¶
func (r *ServiceReader) ByWorkspace(ws string) *ServiceReader
func (*ServiceReader) Do ¶
func (r *ServiceReader) Do() ([]ServiceInfo, error)
Click to show internal directories.
Click to hide internal directories.