Documentation
¶
Index ¶
- Variables
- type CheckType
- type Checker
- type Controller
- type Count
- type Health
- type HealthListResponse
- type Param
- type Params
- type Record
- type Service
- func (s *Service) AddHealth(health *Health) error
- func (s *Service) DeleteHealth(health *Health) error
- func (s *Service) DetailHealth(id uuid.UUID) (*Health, error)
- func (s *Service) GetHealthCheckTypes() []CheckType
- func (s *Service) GetTimeRangeRecord(healthId uuid.UUID, startTime time.Time, endTime time.Time) ([]*Record, error)
- func (s *Service) HealthStatistics() (*Statistics, error)
- func (s *Service) Initialize() error
- func (s *Service) ListHealth(health *Health) ([]*HealthListResponse, error)
- func (s *Service) UpdateHealth(health *Health) error
- type Statistics
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrParam = errors.New("invalid param") StatusError = health.Status("error") )
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(group *gin.RouterGroup)
type Health ¶
type Health 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"`
Type string `json:"type" gorm:"length:32" validate:"oneof=ping ssh http database"`
Enabled bool `json:"enabled"`
Params string `json:"params" validate:"required"`
Status string `json:"status"` // last result
RTT int64 `json:"rtt"` // last result
database.BaseModel
}
type HealthListResponse ¶
type HealthListResponse 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"`
Type string `json:"type" gorm:"length:32" validate:"oneof=ping ssh http database"`
Enabled bool `json:"enabled"`
Status string `json:"status"` // last result
RTT int64 `json:"rtt"` // last result
}
type Record ¶
type Record struct {
ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey" swaggerignore:"true" example:"00000000-0000-0000-0000-000000000000"`
ParentId uuid.UUID `json:"parentId" gorm:"type:uuid;" swaggerignore:"true" example:"00000000-0000-0000-0000-000000000000"`
Status string `json:"status"`
Rtt int64 `json:"rtt"`
Result string `json:"result"` // json string
database.BaseModel
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func GetService ¶
func GetService() *Service
func (*Service) DeleteHealth ¶
func (*Service) GetHealthCheckTypes ¶
func (*Service) GetTimeRangeRecord ¶
func (*Service) HealthStatistics ¶
func (s *Service) HealthStatistics() (*Statistics, error)
func (*Service) Initialize ¶
func (*Service) ListHealth ¶
func (s *Service) ListHealth(health *Health) ([]*HealthListResponse, error)
func (*Service) UpdateHealth ¶
type Statistics ¶
type Statistics struct {
Total int64 `json:"total"`
Up int64 `json:"up"`
Down int64 `json:"down"`
Unknown int64 `json:"unknown"`
Error int64 `json:"error"`
Ping int64 `json:"ping"`
SSH int64 `json:"ssh"`
HTTP int64 `json:"http"`
Database int64 `json:"database"`
ErrorList []*HealthListResponse `json:"errorList"`
SlowList []*HealthListResponse `json:"slowList"` // rtt > 460
}
Click to show internal directories.
Click to hide internal directories.