Documentation
¶
Index ¶
- type CPUInfo
- type Controller
- type DiskInfo
- type DiskItem
- type Group
- type Host
- type MemInfo
- type MetaInfo
- type NetworkInfo
- type NetworkItem
- type ProcessInfo
- type ProcessItem
- type RTT
- type Service
- func (s *Service) AddGroup(group *Group) error
- func (s *Service) AddHost(host *Host) error
- func (s *Service) DeleteGroup(id uuid.UUID) error
- func (s *Service) DeleteHost(id uuid.UUID) error
- func (s *Service) DetailHost(id uuid.UUID) (*Host, error)
- func (s *Service) ExecContainer(ctx *gin.Context, id uuid.UUID, containerId, driver, user, cmd string) error
- func (s *Service) GetContainerLogs(ctx context.Context, id uuid.UUID, containerId string, driver string) (io.ReadCloser, error)
- func (s *Service) GetHostStats(id uuid.UUID) (*Stats, error)
- func (s *Service) Initialize() error
- func (s *Service) ListContainer(id uuid.UUID, driver string) ([]*container.Container, error)
- func (s *Service) ListContainerImage(id uuid.UUID, driver string) ([]*container.Image, error)
- func (s *Service) ListContainerNetwork(id uuid.UUID, driver string) ([]*container.Network, error)
- func (s *Service) ListGroup(group *Group) ([]*Group, error)
- func (s *Service) ListHost(host *Host) ([]*Host, error)
- func (s *Service) UpdateGroup(group *Group) error
- func (s *Service) UpdateHost(host *Host) error
- type Stats
- type StatsCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController() *Controller
func (*Controller) RegisterRoute ¶
func (c *Controller) RegisterRoute(engine *gin.RouterGroup)
type DiskItem ¶
type DiskItem struct {
Partition string `json:"partition"`
SizeBytes int `json:"size_bytes"`
UsedSizeBytes int `json:"used_size_bytes"`
MountPoint string `json:"mount_point"`
FsType string `json:"fs_type"`
ReadSpeedBps int `json:"read_speed_Bps"`
WriteSpeedBps int `json:"write_speed_Bps"`
ReadIops int `json:"read_iops"`
WriteIops int `json:"write_iops"`
ReadLatencyMs int `json:"read_latency_ms"`
WriteLatencyMs int `json:"write_latency_ms"`
TotalReadBytes int `json:"total_read_bytes"`
TotalWriteBytes int `json:"total_write_bytes"`
}
type Group ¶
type Group struct {
ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey" swaggerignore:"true" example:"00000000-0000-0000-0000-000000000000"`
Title string `json:"title" gorm:"unique;not null" validate:"required"`
Hosts []*Host `json:"hosts" gorm:"foreignkey:GroupId" swaggerignore:"true"`
CreatedAt time.Time `json:"createdAt" swaggerignore:"true"`
UpdatedAt time.Time `json:"updatedAt" swaggerignore:"true"`
}
type Host ¶
type Host struct {
ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey" swaggerignore:"true" example:"00000000-0000-0000-0000-000000000000"`
Title string `json:"title" gorm:"not null" validate:"required"`
Desc string `json:"desc"`
HostInfo sshutil.HostInfo `json:"hostInfo" gorm:"not null"`
MetaInfo MetaInfo `json:"metaInfo" swaggerignore:"true"`
Group Group `json:"group" swaggerignore:"true" validate:"omitempty"`
GroupId uuid.UUID `json:"groupId"`
database.BaseModel
}
type MetaInfo ¶
type NetworkInfo ¶
type NetworkInfo []NetworkItem
type NetworkItem ¶
type ProcessInfo ¶
type ProcessInfo []ProcessItem
type ProcessItem ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func GetService ¶
func GetService() *Service
func (*Service) DeleteGroup ¶
DeleteGroup delete host group
func (*Service) DeleteHost ¶
DeleteHost delete host
func (*Service) DetailHost ¶
DetailHost detail host
func (*Service) ExecContainer ¶
func (*Service) GetContainerLogs ¶
func (*Service) Initialize ¶
func (*Service) ListContainer ¶
func (*Service) ListContainerImage ¶
func (*Service) ListContainerNetwork ¶
func (*Service) UpdateGroup ¶
UpdateGroup update host group
type Stats ¶
type Stats struct {
CpuInfo *CPUInfo `json:"cpuInfo"`
MemInfo *MemInfo `json:"memInfo"`
DiskInfo *DiskInfo `json:"diskInfo"`
NetworkInfo *NetworkInfo `json:"networkInfo"`
ProcessInfo *ProcessInfo `json:"processInfo"`
Rtt RTT `json:"rtt"`
// contains filtered or unexported fields
}
type StatsCache ¶
func (*StatsCache) Get ¶
func (sc *StatsCache) Get(key string) *Stats
func (*StatsCache) Set ¶
func (sc *StatsCache) Set(key string, value any)
Click to show internal directories.
Click to hide internal directories.