Documentation
¶
Index ¶
- func FormatIssuer(cert *x509.Certificate) string
- func ParseCertificatePEM(certPEM string) (*x509.Certificate, error)
- func UpdateCertificateStatus(cert *model.Certificate)
- type AddAlertRequest
- type AddAlertResponse
- type AddRequest
- type AddResponse
- type AlertItem
- type Certificate
- type CertificateAddRequest
- type CertificateAddResponse
- type CertificateAlertAddRequest
- type CertificateAlertAddResponse
- type CertificateAlertItem
- type CertificateAlertsListRequest
- type CertificateAlertsListResponse
- type CertificateCheckAllRequest
- type CertificateCheckAllResponse
- type CertificateCheckRequest
- type CertificateCheckResponse
- type CertificateDeleteRequest
- type CertificateDeleteResponse
- type CertificateDetailRequest
- type CertificateDetailResponse
- type CertificateDomainInfoRequest
- type CertificateDomainInfoResponse
- type CertificateExpiringRequest
- type CertificateExpiringResponse
- type CertificateItem
- type CertificateStatsRequest
- type CertificateStatsResponse
- type CertificatesListRequest
- type CertificatesListResponse
- type CheckAllRequest
- type CheckAllResponse
- type CheckRequest
- type CheckResponse
- type DeleteRequest
- type DomainInfoRequest
- type DomainInfoResponse
- type ExpiringRequest
- type ExpiringResponse
- type GetRequest
- type GetResponse
- type Handler
- func (h *Handler) Add(c *gin.Context)
- func (h *Handler) AddAlert(c *gin.Context)
- func (h *Handler) AlertsList(c *gin.Context)
- func (h *Handler) Check(c *gin.Context)
- func (h *Handler) CheckAll(c *gin.Context)
- func (h *Handler) Delete(c *gin.Context)
- func (h *Handler) DomainInfo(c *gin.Context)
- func (h *Handler) Expiring(c *gin.Context)
- func (h *Handler) Get(c *gin.Context)
- func (h *Handler) GetDomainInfo(c *gin.Context)
- func (h *Handler) GetExpiring(c *gin.Context)
- func (h *Handler) List(c *gin.Context)
- func (h *Handler) ListAlerts(c *gin.Context)
- func (h *Handler) Stats(c *gin.Context)
- type ListAlertsRequest
- type ListAlertsResponse
- type ListRequest
- type ListResponse
- type Service
- func (s *Service) Add(ctx context.Context, req *AddRequest) (*AddResponse, error)
- func (s *Service) AddAlert(ctx context.Context, req *AddAlertRequest) (*AddAlertResponse, error)
- func (s *Service) Check(ctx context.Context, req *CheckRequest) (*CheckResponse, error)
- func (s *Service) CheckAll(ctx context.Context) (*CheckAllResponse, error)
- func (s *Service) Delete(ctx context.Context, req *DeleteRequest) error
- func (s *Service) Get(ctx context.Context, req *GetRequest) (*GetResponse, error)
- func (s *Service) GetDomainInfo(ctx context.Context, req *DomainInfoRequest) (*DomainInfoResponse, error)
- func (s *Service) GetExpiring(ctx context.Context, req *ExpiringRequest) (*ExpiringResponse, error)
- func (s *Service) List(ctx context.Context, req *ListRequest) (*ListResponse, error)
- func (s *Service) ListAlerts(ctx context.Context, req *ListAlertsRequest) (*ListAlertsResponse, error)
- func (s *Service) Stats(ctx context.Context) (*StatsResponse, error)
- type StatsRequest
- type StatsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatIssuer ¶
func FormatIssuer(cert *x509.Certificate) string
FormatIssuer formats the certificate issuer for display
func ParseCertificatePEM ¶
func ParseCertificatePEM(certPEM string) (*x509.Certificate, error)
ParseCertificatePEM parses a PEM-encoded certificate
func UpdateCertificateStatus ¶
func UpdateCertificateStatus(cert *model.Certificate)
UpdateCertificateStatus updates the certificate status based on expiration
Types ¶
type AddAlertRequest ¶
type AddAlertRequest = CertificateAlertAddRequest
type AddAlertResponse ¶
type AddAlertResponse = CertificateAlertAddResponse
type AddRequest ¶
type AddRequest = CertificateAddRequest
type AddResponse ¶
type AddResponse = CertificateAddResponse
type AlertItem ¶
type AlertItem = CertificateAlertItem
type Certificate ¶
type Certificate struct {
ID uint `json:"id"`
Domain string `json:"domain"`
Issuer string `json:"issuer"`
ExpiresAt string `json:"expiresAt"`
Status string `json:"status"`
LastCheckedAt string `json:"lastCheckedAt"`
ErrorMessage string `json:"errorMessage,omitempty"`
CreatedAt string `json:"createdAt"`
}
Certificate represents a certificate entity
type CertificateAddRequest ¶
type CertificateAddRequest struct {
Domain string `json:"domain"`
Certificate string `json:"certificate"`
PrivateKey string `json:"privateKey"`
}
CertificateAddRequest is the request to add a certificate
type CertificateAddResponse ¶
type CertificateAddResponse struct {
Certificate CertificateItem `json:"certificate"`
}
CertificateAddResponse is the response from adding a certificate
type CertificateAlertAddRequest ¶
type CertificateAlertAddRequest struct {
Domain string `json:"domain"`
Threshold int `json:"threshold"`
}
CertificateAlertAddRequest is the request to add a certificate alert
type CertificateAlertAddResponse ¶
type CertificateAlertAddResponse struct {
ID uint `json:"id"`
Domain string `json:"domain"`
ThresholdDays int `json:"thresholdDays"`
}
CertificateAlertAddResponse is the response from adding a certificate alert
type CertificateAlertItem ¶
type CertificateAlertItem struct {
ID uint `json:"id"`
Domain string `json:"domain"`
ThresholdDays int `json:"thresholdDays"`
Active bool `json:"active"`
LastTriggeredAt string `json:"lastTriggeredAt,omitempty"`
CreatedAt string `json:"createdAt"`
}
CertificateAlertItem represents a certificate alert
type CertificateAlertsListRequest ¶
CertificateAlertsListRequest is the request to list certificate alerts
type CertificateAlertsListResponse ¶
type CertificateAlertsListResponse struct {
Items []CertificateAlertItem `json:"items"`
Total int64 `json:"total"`
Page int `json:"page"`
Size int `json:"size"`
}
CertificateAlertsListResponse is the response with certificate alerts list
type CertificateCheckAllRequest ¶
type CertificateCheckAllRequest struct {
}
CertificateCheckAllRequest is the request to check all certificates
type CertificateCheckAllResponse ¶
type CertificateCheckAllResponse struct {
Checked int `json:"checked"`
Failed int `json:"failed"`
Total int `json:"total"`
}
CertificateCheckAllResponse is the response from checking all certificates
type CertificateCheckRequest ¶
type CertificateCheckRequest struct {
ID string `uri:"id"`
}
CertificateCheckRequest is the request to check a certificate
type CertificateCheckResponse ¶
type CertificateCheckResponse struct {
Certificate CertificateItem `json:"certificate"`
}
CertificateCheckResponse is the response from checking a certificate
type CertificateDeleteRequest ¶
type CertificateDeleteRequest struct {
ID string `uri:"id"`
}
CertificateDeleteRequest is the request to delete a certificate
type CertificateDeleteResponse ¶
type CertificateDeleteResponse struct {
Message string `json:"message"`
}
CertificateDeleteResponse is the response from deleting a certificate
type CertificateDetailRequest ¶
type CertificateDetailRequest struct {
ID string `uri:"id"`
}
CertificateDetailRequest is the request to get certificate details
type CertificateDetailResponse ¶
type CertificateDetailResponse struct {
Certificate CertificateItem `json:"certificate"`
}
CertificateDetailResponse is the response with certificate details
type CertificateDomainInfoRequest ¶
type CertificateDomainInfoRequest struct {
Domain string `form:"domain"`
}
CertificateDomainInfoRequest is the request to get domain certificate info
type CertificateDomainInfoResponse ¶
type CertificateDomainInfoResponse struct {
Certificate CertificateItem `json:"certificate"`
}
CertificateDomainInfoResponse is the response with domain certificate info
type CertificateExpiringRequest ¶
type CertificateExpiringRequest struct {
Days int `form:"days"`
}
CertificateExpiringRequest is the request to get expiring certificates
type CertificateExpiringResponse ¶
type CertificateExpiringResponse struct {
Items []CertificateItem `json:"items"`
Days int `json:"days"`
}
CertificateExpiringResponse is the response with expiring certificates
type CertificateItem ¶
type CertificateItem struct {
ID uint `json:"id"`
Domain string `json:"domain"`
Issuer string `json:"issuer"`
ExpiresAt string `json:"expiresAt"`
Status string `json:"status"`
LastCheckedAt string `json:"lastCheckedAt"`
ErrorMessage string `json:"errorMessage,omitempty"`
CreatedAt string `json:"createdAt"`
}
CertificateItem represents a certificate in the list
func BuildCertificateDTO ¶
func BuildCertificateDTO(cert *model.Certificate) CertificateItem
BuildCertificateDTO builds a certificate DTO from model
type CertificateStatsRequest ¶
type CertificateStatsRequest struct {
}
CertificateStatsRequest is the request to get certificate statistics
type CertificateStatsResponse ¶
type CertificateStatsResponse struct {
Total int64 `json:"total"`
Valid int64 `json:"valid"`
Expiring int64 `json:"expiring"`
Expired int64 `json:"expired"`
Invalid int64 `json:"invalid"`
}
CertificateStatsResponse is the response with certificate statistics
type CertificatesListRequest ¶
type CertificatesListRequest struct {
Page int `form:"page"`
PageSize int `form:"pageSize"`
Status string `form:"status"`
}
CertificatesListRequest is the request to list certificates
type CertificatesListResponse ¶
type CertificatesListResponse struct {
Items []CertificateItem `json:"items"`
Total int64 `json:"total"`
Page int `json:"page"`
Size int `json:"size"`
}
CertificatesListResponse is the response with certificates list
type CheckAllRequest ¶
type CheckAllRequest = CertificateCheckAllRequest
type CheckAllResponse ¶
type CheckAllResponse = CertificateCheckAllResponse
type CheckRequest ¶
type CheckRequest = CertificateCheckRequest
type CheckResponse ¶
type CheckResponse = CertificateCheckResponse
type DeleteRequest ¶
type DeleteRequest = CertificateDeleteRequest
type DomainInfoRequest ¶
type DomainInfoRequest = CertificateDomainInfoRequest
type DomainInfoResponse ¶
type DomainInfoResponse = CertificateDomainInfoResponse
type ExpiringRequest ¶
type ExpiringRequest = CertificateExpiringRequest
type ExpiringResponse ¶
type ExpiringResponse = CertificateExpiringResponse
type GetRequest ¶
type GetRequest = CertificateDetailRequest
type GetResponse ¶
type GetResponse = CertificateDetailResponse
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) AlertsList ¶
func (*Handler) DomainInfo ¶
func (*Handler) GetDomainInfo ¶
GetDomainInfo handles the request to get domain certificate info
func (*Handler) GetExpiring ¶
GetExpiring handles the request to get expiring certificates
func (*Handler) ListAlerts ¶
ListAlerts handles the request to list certificate alerts
type ListAlertsRequest ¶
type ListAlertsRequest = CertificateAlertsListRequest
type ListAlertsResponse ¶
type ListAlertsResponse = CertificateAlertsListResponse
type ListRequest ¶
type ListRequest = CertificatesListRequest
Type aliases for backward compatibility
type ListResponse ¶
type ListResponse = CertificatesListResponse
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(svcCtx *svc.ServiceContext) *Service
func (*Service) Add ¶
func (s *Service) Add(ctx context.Context, req *AddRequest) (*AddResponse, error)
Add adds a new certificate
func (*Service) AddAlert ¶
func (s *Service) AddAlert(ctx context.Context, req *AddAlertRequest) (*AddAlertResponse, error)
AddAlert adds a certificate alert
func (*Service) Check ¶
func (s *Service) Check(ctx context.Context, req *CheckRequest) (*CheckResponse, error)
Check checks certificate status
func (*Service) CheckAll ¶
func (s *Service) CheckAll(ctx context.Context) (*CheckAllResponse, error)
CheckAll checks all certificates
func (*Service) Delete ¶
func (s *Service) Delete(ctx context.Context, req *DeleteRequest) error
Delete deletes a certificate
func (*Service) Get ¶
func (s *Service) Get(ctx context.Context, req *GetRequest) (*GetResponse, error)
Get returns certificate details
func (*Service) GetDomainInfo ¶
func (s *Service) GetDomainInfo(ctx context.Context, req *DomainInfoRequest) (*DomainInfoResponse, error)
GetDomainInfo returns certificate info for a domain
func (*Service) GetExpiring ¶
func (s *Service) GetExpiring(ctx context.Context, req *ExpiringRequest) (*ExpiringResponse, error)
GetExpiring returns certificates expiring within specified days
func (*Service) List ¶
func (s *Service) List(ctx context.Context, req *ListRequest) (*ListResponse, error)
List returns a list of certificates
func (*Service) ListAlerts ¶
func (s *Service) ListAlerts(ctx context.Context, req *ListAlertsRequest) (*ListAlertsResponse, error)
ListAlerts returns a list of certificate alerts
type StatsRequest ¶
type StatsRequest = CertificateStatsRequest
type StatsResponse ¶
type StatsResponse = CertificateStatsResponse