Documentation
¶
Index ¶
- type Certificate
- type CertificateAlert
- type CertificateStats
- type DomainInfo
- type Store
- func (s *Store) AddAlert(certID uint, alertType, target string) error
- func (s *Store) AddDomain(domain string, port int, alertDays int) error
- func (s *Store) AutoMigrate() error
- func (s *Store) CheckAllCertificates() error
- func (s *Store) CheckCertificate(certID uint) error
- func (s *Store) Delete(id uint) error
- func (s *Store) GetAlertsForCertificate(certID uint) ([]CertificateAlert, error)
- func (s *Store) GetByID(id uint) (*Certificate, error)
- func (s *Store) GetCertificateStats() (*CertificateStats, error)
- func (s *Store) GetDomainInfo(domain string) (*DomainInfo, error)
- func (s *Store) GetExpiringCertificates() ([]Certificate, error)
- func (s *Store) ListCertificates(page, size int, status string) ([]Certificate, int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Certificate ¶
type Certificate struct {
ID uint `gorm:"primaryKey"`
Domain string `gorm:"column:domain;uniqueIndex;size:255"`
Port int `gorm:"column:port;default:443"`
Issuer string `gorm:"column:issuer;size:500"`
Subject string `gorm:"column:subject;size:500"`
Algorithm string `gorm:"column:algorithm;size:100"`
KeyUsage string `gorm:"column:key_usage;size:200"`
ValidFrom time.Time `gorm:"column:valid_from"`
ValidTo time.Time `gorm:"column:valid_to"`
DaysLeft int `gorm:"column:days_left"`
Status string `gorm:"column:status;size:50"` // valid, expired, expiring, error
LastChecked time.Time `gorm:"column:last_checked"`
ErrorMsg string `gorm:"column:error_msg;type:text"`
AlertDays int `gorm:"column:alert_days;default:30"` // Alert when days left <= this value
Enabled bool `gorm:"column:enabled;default:true"`
CreatedAt time.Time
UpdatedAt time.Time
}
Certificate represents a monitored SSL certificate
func (Certificate) TableName ¶
func (Certificate) TableName() string
type CertificateAlert ¶
type CertificateAlert struct {
ID uint `gorm:"primaryKey"`
CertificateID uint `gorm:"column:certificate_id;index"`
AlertType string `gorm:"column:alert_type;size:50"` // email, sms, webhook, chat
Target string `gorm:"column:target;size:500"` // email address, phone, webhook URL, chat ID
Enabled bool `gorm:"column:enabled;default:true"`
LastSent *time.Time `gorm:"column:last_sent"`
CreatedAt time.Time
UpdatedAt time.Time
Certificate Certificate `gorm:"foreignKey:CertificateID"`
}
CertificateAlert represents alert configuration
func (CertificateAlert) TableName ¶
func (CertificateAlert) TableName() string
type CertificateStats ¶
type CertificateStats struct {
Total int64 `json:"total"`
Valid int64 `json:"valid"`
Expiring int64 `json:"expiring"`
Expired int64 `json:"expired"`
Errors int64 `json:"errors"`
LastChecked time.Time `json:"last_checked"`
}
CertificateStats contains certificate statistics
type DomainInfo ¶
type DomainInfo struct {
Domain string `json:"domain"`
Registrar string `json:"registrar"`
RegistrationDate *time.Time `json:"registration_date,omitempty"`
ExpirationDate *time.Time `json:"expiration_date,omitempty"`
NameServers []string `json:"name_servers"`
DaysToExpiry int `json:"days_to_expiry"`
Status string `json:"status"`
}
DomainInfo contains domain registration information
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store handles certificate monitoring
func (*Store) AutoMigrate ¶
AutoMigrate creates certificate tables
func (*Store) CheckAllCertificates ¶
CheckAllCertificates checks all enabled certificates
func (*Store) CheckCertificate ¶
CheckCertificate checks a single certificate
func (*Store) GetAlertsForCertificate ¶
func (s *Store) GetAlertsForCertificate(certID uint) ([]CertificateAlert, error)
GetAlertsForCertificate returns alerts for a specific certificate
func (*Store) GetByID ¶
func (s *Store) GetByID(id uint) (*Certificate, error)
GetByID returns a certificate by ID
func (*Store) GetCertificateStats ¶
func (s *Store) GetCertificateStats() (*CertificateStats, error)
GetCertificateStats returns certificate statistics
func (*Store) GetDomainInfo ¶
func (s *Store) GetDomainInfo(domain string) (*DomainInfo, error)
GetDomainInfo attempts to get domain registration info (basic implementation)
func (*Store) GetExpiringCertificates ¶
func (s *Store) GetExpiringCertificates() ([]Certificate, error)
GetExpiringCertificates returns certificates that are expiring or expired
func (*Store) ListCertificates ¶
ListCertificates returns all certificates with pagination