mirror of
https://github.com/shankar0123/certctl.git
synced 2026-06-12 20:08:53 +00:00
fix: use repository.DiscoveryFilter in postgres implementation to satisfy interface
The postgres DiscoveryRepository had a duplicate local DiscoveryFilter struct instead of using repository.DiscoveryFilter, causing a type mismatch that broke CI build. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
|||||||
|
|
||||||
"github.com/lib/pq"
|
"github.com/lib/pq"
|
||||||
"github.com/shankar0123/certctl/internal/domain"
|
"github.com/shankar0123/certctl/internal/domain"
|
||||||
|
"github.com/shankar0123/certctl/internal/repository"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DiscoveryRepository implements the repository.DiscoveryRepository interface.
|
// DiscoveryRepository implements the repository.DiscoveryRepository interface.
|
||||||
@@ -205,7 +206,7 @@ func (r *DiscoveryRepository) GetDiscovered(ctx context.Context, id string) (*do
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ListDiscovered returns discovered certificates matching the filter.
|
// ListDiscovered returns discovered certificates matching the filter.
|
||||||
func (r *DiscoveryRepository) ListDiscovered(ctx context.Context, filter *DiscoveryFilter) ([]*domain.DiscoveredCertificate, int, error) {
|
func (r *DiscoveryRepository) ListDiscovered(ctx context.Context, filter *repository.DiscoveryFilter) ([]*domain.DiscoveredCertificate, int, error) {
|
||||||
if filter.Page < 1 {
|
if filter.Page < 1 {
|
||||||
filter.Page = 1
|
filter.Page = 1
|
||||||
}
|
}
|
||||||
@@ -386,16 +387,6 @@ func (r *DiscoveryRepository) CountByStatus(ctx context.Context) (map[string]int
|
|||||||
return counts, nil
|
return counts, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DiscoveryFilter defines filters for listing discovered certificates.
|
|
||||||
type DiscoveryFilter struct {
|
|
||||||
AgentID string
|
|
||||||
Status string
|
|
||||||
IsExpired bool
|
|
||||||
IsCA bool
|
|
||||||
Page int
|
|
||||||
PerPage int
|
|
||||||
}
|
|
||||||
|
|
||||||
// nullableString returns a sql.NullString, null if the string is empty.
|
// nullableString returns a sql.NullString, null if the string is empty.
|
||||||
func nullableString(s string) sql.NullString {
|
func nullableString(s string) sql.NullString {
|
||||||
if s == "" {
|
if s == "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user