instanceinfo

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2021 License: Apache-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(db *dbengine.DBEngine) *Client

func (*Client) InstanceReader

func (c *Client) InstanceReader() *instanceReader

func (*Client) InstanceWriter

func (c *Client) InstanceWriter() *instanceWriter

func (*Client) PodReader

func (c *Client) PodReader() *podReader

func (*Client) PodWriter

func (c *Client) PodWriter() *podWriter

func (*Client) ServiceReader

func (c *Client) ServiceReader() *serviceReader

func (*Client) ServiceWriter

func (c *Client) ServiceWriter() *serviceWriter

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) Metadata

func (i InstanceInfo) Metadata(k string) (string, bool)

func (InstanceInfo) TableName

func (InstanceInfo) TableName() string

type InstancePhase

type InstancePhase string

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
}

func (PodInfo) TableName

func (PodInfo) TableName() string

type PodPhase

type PodPhase string

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL