Documentation
¶
Index ¶
- Variables
- func InitAlertChecker(db *gorm.DB, interval time.Duration)
- func SendAlertToChannels(rule *models.AlertRule, value float64, message string)
- func StopAlertChecker()
- type AlertChecker
- type AppConfig
- type AuditService
- func (s *AuditService) CleanOldLogs(db *gorm.DB, days int) error
- func (s *AuditService) GetAuditLogs(db *gorm.DB, userID string, logType models.AuditLogType, page, pageSize int) ([]*models.AuditLog, int64, error)
- func (s *AuditService) GetLoginLogs(db *gorm.DB, userID string, page, pageSize int) ([]*models.LoginLog, int64, error)
- func (s *AuditService) Log(db *gorm.DB, log *models.AuditLog) error
- func (s *AuditService) LogLogin(db *gorm.DB, userID, username, ip, userAgent, message string, success bool) error
- func (s *AuditService) LogLogout(db *gorm.DB, userID string) error
- func (s *AuditService) LogWithContext(db *gorm.DB, logType string, ...) error
- type DingTalkChannel
- type EmailChannel
- type LogCleanerService
- type LogFileInfo
- type Monitor
- type NotificationChannel
- type NotificationService
- func (s *NotificationService) Broadcast(notice *models.Notice)
- func (s *NotificationService) GetOnlineInfo() map[string]interface{}
- func (s *NotificationService) IsUserOnline(userID string) bool
- func (s *NotificationService) KickUser(userID string, reason string)
- func (s *NotificationService) SendToUser(userID string, notice *models.Notice) bool
- type Option
- func (e *Option) GetOption(ctx context.Context, category, name string) (*models.Option, error)
- func (e *Option) GetOptions(ctx context.Context, queries []struct{ ... }) ([]*models.Option, error)
- func (e *Option) InvalidateCache(ctx context.Context, category, name string) error
- func (e *Option) UpdateOption(ctx context.Context, id string, items *models.OptionItems, ...) error
- type Statistics
- type Storage
- type UploadResult
- type UserConfig
- type WeChatChannel
Constants ¶
This section is empty.
Variables ¶
View Source
var Audit = &AuditService{}
View Source
var LogCleaner = &LogCleanerService{}
View Source
var Notification = &NotificationService{}
Functions ¶
func SendAlertToChannels ¶ added in v0.7.0
func StopAlertChecker ¶ added in v0.7.0
func StopAlertChecker()
Types ¶
type AlertChecker ¶ added in v0.7.0
type AlertChecker struct {
// contains filtered or unexported fields
}
func (*AlertChecker) Run ¶ added in v0.7.0
func (a *AlertChecker) Run()
type AppConfig ¶
type AppConfig struct{}
func (*AppConfig) CreateOrUpdate ¶
type AuditService ¶ added in v0.7.0
type AuditService struct{}
func (*AuditService) CleanOldLogs ¶ added in v0.7.0
func (s *AuditService) CleanOldLogs(db *gorm.DB, days int) error
func (*AuditService) GetAuditLogs ¶ added in v0.7.0
func (*AuditService) GetLoginLogs ¶ added in v0.7.0
type DingTalkChannel ¶ added in v0.7.0
type DingTalkChannel struct {
// contains filtered or unexported fields
}
func (*DingTalkChannel) Name ¶ added in v0.7.0
func (c *DingTalkChannel) Name() string
type EmailChannel ¶ added in v0.7.0
type EmailChannel struct {
// contains filtered or unexported fields
}
func (*EmailChannel) Name ¶ added in v0.7.0
func (c *EmailChannel) Name() string
type LogCleanerService ¶ added in v0.7.0
type LogCleanerService struct{}
func (*LogCleanerService) CleanOldLogs ¶ added in v0.7.0
func (s *LogCleanerService) CleanOldLogs(db *gorm.DB, retentionDays int) error
func (*LogCleanerService) CleanOldRuntimeLogs ¶ added in v0.7.0
func (s *LogCleanerService) CleanOldRuntimeLogs(logDir string, retentionDays int) error
type LogFileInfo ¶ added in v0.7.0
type NotificationChannel ¶ added in v0.7.0
type NotificationChannel interface {
Send(rule *models.AlertRule, value float64, message string) error
Name() string
}
func GetEnabledChannels ¶ added in v0.7.0
func GetEnabledChannels() []NotificationChannel
type NotificationService ¶ added in v0.7.0
type NotificationService struct{}
func (*NotificationService) Broadcast ¶ added in v0.7.0
func (s *NotificationService) Broadcast(notice *models.Notice)
func (*NotificationService) GetOnlineInfo ¶ added in v0.7.0
func (s *NotificationService) GetOnlineInfo() map[string]interface{}
func (*NotificationService) IsUserOnline ¶ added in v0.7.0
func (s *NotificationService) IsUserOnline(userID string) bool
func (*NotificationService) KickUser ¶ added in v0.7.0
func (s *NotificationService) KickUser(userID string, reason string)
func (*NotificationService) SendToUser ¶ added in v0.7.0
func (s *NotificationService) SendToUser(userID string, notice *models.Notice) bool
type Option ¶ added in v0.7.0
type Option struct{}
func (*Option) GetOptions ¶ added in v0.7.0
func (*Option) InvalidateCache ¶ added in v0.7.0
func (*Option) UpdateOption ¶ added in v0.7.0
type Statistics ¶
type Statistics struct{}
func (*Statistics) Get ¶
func (*Statistics) Get(ctx *gin.Context, name string) (*dto.StatisticsGetResponse, error)
type Storage ¶
type Storage struct{}
func (*Storage) Upload ¶
func (s *Storage) Upload(c *gin.Context, f *multipart.FileHeader, userID string) (*UploadResult, error)
type UploadResult ¶ added in v0.7.0
type UserConfig ¶
type UserConfig struct{}
func (*UserConfig) CreateOrUpdate ¶
type WeChatChannel ¶ added in v0.7.0
type WeChatChannel struct {
// contains filtered or unexported fields
}
func (*WeChatChannel) Name ¶ added in v0.7.0
func (c *WeChatChannel) Name() string
Click to show internal directories.
Click to hide internal directories.