Documentation
¶
Overview ¶
Package testutil provides mock implementations for testing DNS components.
Index ¶
- type MockDNSService
- func (m *MockDNSService) CreateRecord(_ context.Context, record *domain.Record) error
- func (m *MockDNSService) CreateZone(_ context.Context, zone *domain.Zone) error
- func (m *MockDNSService) DeleteRecord(_ context.Context, recordID string, zoneID string, tenantID string) error
- func (m *MockDNSService) DeleteZone(_ context.Context, zoneID string, tenantID string) error
- func (m *MockDNSService) GetRecordsToProbeStreaming(_ context.Context) (ports.RecordIterator, error)
- func (m *MockDNSService) HealthCheck(_ context.Context) map[string]error
- func (m *MockDNSService) ImportZone(_ context.Context, tenantID string, r io.Reader) (*domain.Zone, error)
- func (m *MockDNSService) ListAuditLogs(_ context.Context, tenantID string) ([]domain.AuditLog, error)
- func (m *MockDNSService) ListRecordsForZone(_ context.Context, zoneID string, tenantID string) ([]domain.Record, error)
- func (m *MockDNSService) ListZones(_ context.Context, tenantID string) ([]domain.Zone, error)
- func (m *MockDNSService) Resolve(_ context.Context, name string, qType domain.RecordType, clientIP string) ([]domain.Record, error)
- func (m *MockDNSService) UpdateRecord(_ context.Context, record *domain.Record) error
- func (m *MockDNSService) UpdateRecordHealth(_ context.Context, recordID string, status domain.HealthStatus, errMsg string) error
- type MockRepo
- func (m *MockRepo) ApplyZoneUpdate(_ context.Context, zoneID string, operations []domain.UpdateOperation, ...) (uint32, error)
- func (m *MockRepo) BatchCreateRecords(_ context.Context, records []domain.Record) error
- func (m *MockRepo) CreateAPIKey(_ context.Context, key *domain.APIKey) error
- func (m *MockRepo) CreateKey(_ context.Context, key *domain.DNSSECKey) error
- func (m *MockRepo) CreateRecord(_ context.Context, record *domain.Record) error
- func (m *MockRepo) CreateZone(_ context.Context, zone *domain.Zone) error
- func (m *MockRepo) CreateZoneWithRecords(_ context.Context, zone *domain.Zone, records []domain.Record) error
- func (m *MockRepo) DeleteAPIKey(_ context.Context, tenantID string, id string) error
- func (m *MockRepo) DeleteRecord(_ context.Context, recordID string, zoneID string, tenantID string) error
- func (m *MockRepo) DeleteRecordSpecific(_ context.Context, zoneID string, name string, qType domain.RecordType, ...) error
- func (m *MockRepo) DeleteRecordsByName(_ context.Context, zoneID string, name string) error
- func (m *MockRepo) DeleteRecordsByNameAndType(_ context.Context, zoneID string, name string, qType domain.RecordType) error
- func (m *MockRepo) DeleteRecordsForZone(_ context.Context, zoneID string) error
- func (m *MockRepo) DeleteZone(_ context.Context, zoneID string, tenantID string) error
- func (m *MockRepo) GetAPIKeyByHash(_ context.Context, keyHash string) (*domain.APIKey, error)
- func (m *MockRepo) GetAuditLogs(_ context.Context, tenantID string) ([]domain.AuditLog, error)
- func (m *MockRepo) GetDNSKEYs(_ context.Context, zoneName string) ([]domain.Record, error)
- func (m *MockRepo) GetIPsForName(_ context.Context, name string, clientIP string) ([]string, error)
- func (m *MockRepo) GetIXFRChain(_ context.Context, zoneID string, fromSerial uint32, toSerial uint32) ([]domain.IXFRChunk, error)
- func (m *MockRepo) GetRecord(_ context.Context, id string, zoneID string, tenantID string) (*domain.Record, error)
- func (m *MockRepo) GetRecords(_ context.Context, name string, qType domain.RecordType, clientIP string) ([]domain.Record, error)
- func (m *MockRepo) GetRecordsByNames(_ context.Context, names []string, qType domain.RecordType, clientIP string) (map[string][]domain.Record, error)
- func (m *MockRepo) GetRecordsToProbeStreaming(_ context.Context) (ports.RecordIterator, error)
- func (m *MockRepo) GetZone(_ context.Context, name string) (*domain.Zone, error)
- func (m *MockRepo) GetZoneLongestMatch(_ context.Context, qName string) (*domain.Zone, error)
- func (m *MockRepo) ListAPIKeys(_ context.Context, tenantID string) ([]domain.APIKey, error)
- func (m *MockRepo) ListKeysForZone(_ context.Context, zoneID string) ([]domain.DNSSECKey, error)
- func (m *MockRepo) ListRecordsForZone(_ context.Context, zoneID string, tenantID string) ([]domain.Record, error)
- func (m *MockRepo) ListRecordsForZoneStreaming(_ context.Context, zoneID string, tenantID string) (ports.RecordIterator, error)
- func (m *MockRepo) ListZoneChanges(_ context.Context, zoneID string, fromSerial uint32) ([]domain.ZoneChange, error)
- func (m *MockRepo) ListZones(_ context.Context, tenantID string) ([]domain.Zone, error)
- func (m *MockRepo) Ping(_ context.Context) error
- func (m *MockRepo) RecordZoneChange(_ context.Context, change *domain.ZoneChange) error
- func (m *MockRepo) SaveAuditLog(_ context.Context, log *domain.AuditLog) error
- func (m *MockRepo) UpdateKey(_ context.Context, key *domain.DNSSECKey) error
- func (m *MockRepo) UpdateRecord(_ context.Context, record *domain.Record) error
- func (m *MockRepo) UpdateRecordHealth(ctx context.Context, recordID string, status domain.HealthStatus, ...) error
- type MockRoutingEngine
- type MockVIPManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockDNSService ¶
MockDNSService implements ports.DNSService for testing.
func (*MockDNSService) CreateRecord ¶
CreateRecord implements ports.DNSService for testing.
func (*MockDNSService) CreateZone ¶
CreateZone implements ports.DNSService for testing.
func (*MockDNSService) DeleteRecord ¶
func (m *MockDNSService) DeleteRecord(_ context.Context, recordID string, zoneID string, tenantID string) error
DeleteRecord implements ports.DNSService for testing.
func (*MockDNSService) DeleteZone ¶
DeleteZone implements ports.DNSService for testing.
func (*MockDNSService) GetRecordsToProbeStreaming ¶
func (m *MockDNSService) GetRecordsToProbeStreaming(_ context.Context) (ports.RecordIterator, error)
GetRecordsToProbeStreaming implements ports.DNSService for testing.
func (*MockDNSService) HealthCheck ¶
func (m *MockDNSService) HealthCheck(_ context.Context) map[string]error
HealthCheck implements ports.DNSService for testing.
func (*MockDNSService) ImportZone ¶
func (m *MockDNSService) ImportZone(_ context.Context, tenantID string, r io.Reader) (*domain.Zone, error)
ImportZone implements ports.DNSService for testing.
func (*MockDNSService) ListAuditLogs ¶
func (m *MockDNSService) ListAuditLogs(_ context.Context, tenantID string) ([]domain.AuditLog, error)
ListAuditLogs implements ports.DNSService for testing.
func (*MockDNSService) ListRecordsForZone ¶
func (m *MockDNSService) ListRecordsForZone(_ context.Context, zoneID string, tenantID string) ([]domain.Record, error)
ListRecordsForZone implements ports.DNSService for testing.
func (*MockDNSService) Resolve ¶
func (m *MockDNSService) Resolve(_ context.Context, name string, qType domain.RecordType, clientIP string) ([]domain.Record, error)
Resolve implements ports.DNSService for testing.
func (*MockDNSService) UpdateRecord ¶
UpdateRecord implements ports.DNSService for testing.
func (*MockDNSService) UpdateRecordHealth ¶
func (m *MockDNSService) UpdateRecordHealth(_ context.Context, recordID string, status domain.HealthStatus, errMsg string) error
UpdateRecordHealth implements ports.DNSService for testing.
type MockRepo ¶
MockRepo implements ports.DNSRepository for testing.
func (*MockRepo) ApplyZoneUpdate ¶
func (m *MockRepo) ApplyZoneUpdate(_ context.Context, zoneID string, operations []domain.UpdateOperation, changes []domain.ZoneChange) (uint32, error)
ApplyZoneUpdate implements ports.DNSRepository for testing.
func (*MockRepo) BatchCreateRecords ¶
BatchCreateRecords implements ports.DNSRepository for testing.
func (*MockRepo) CreateAPIKey ¶
CreateAPIKey implements ports.DNSRepository for testing.
func (*MockRepo) CreateRecord ¶
CreateRecord implements ports.DNSRepository for testing.
func (*MockRepo) CreateZone ¶
CreateZone implements ports.DNSRepository for testing.
func (*MockRepo) CreateZoneWithRecords ¶
func (m *MockRepo) CreateZoneWithRecords(_ context.Context, zone *domain.Zone, records []domain.Record) error
CreateZoneWithRecords implements ports.DNSRepository for testing.
func (*MockRepo) DeleteAPIKey ¶
DeleteAPIKey implements ports.DNSRepository for testing.
func (*MockRepo) DeleteRecord ¶
func (m *MockRepo) DeleteRecord(_ context.Context, recordID string, zoneID string, tenantID string) error
DeleteRecord implements ports.DNSRepository for testing.
func (*MockRepo) DeleteRecordSpecific ¶
func (m *MockRepo) DeleteRecordSpecific(_ context.Context, zoneID string, name string, qType domain.RecordType, content string) error
DeleteRecordSpecific implements ports.DNSRepository for testing.
func (*MockRepo) DeleteRecordsByName ¶
DeleteRecordsByName implements ports.DNSRepository for testing.
func (*MockRepo) DeleteRecordsByNameAndType ¶
func (m *MockRepo) DeleteRecordsByNameAndType(_ context.Context, zoneID string, name string, qType domain.RecordType) error
DeleteRecordsByNameAndType implements ports.DNSRepository for testing.
func (*MockRepo) DeleteRecordsForZone ¶
DeleteRecordsForZone implements ports.DNSRepository for testing.
func (*MockRepo) DeleteZone ¶
DeleteZone implements ports.DNSRepository for testing.
func (*MockRepo) GetAPIKeyByHash ¶
GetAPIKeyByHash implements ports.DNSRepository for testing.
func (*MockRepo) GetAuditLogs ¶
GetAuditLogs implements ports.DNSRepository for testing.
func (*MockRepo) GetDNSKEYs ¶
GetDNSKEYs implements ports.DNSRepository for testing.
func (*MockRepo) GetIPsForName ¶
GetIPsForName implements ports.DNSRepository for testing.
func (*MockRepo) GetIXFRChain ¶
func (m *MockRepo) GetIXFRChain(_ context.Context, zoneID string, fromSerial uint32, toSerial uint32) ([]domain.IXFRChunk, error)
GetIXFRChain implements ports.DNSRepository for testing.
func (*MockRepo) GetRecord ¶
func (m *MockRepo) GetRecord(_ context.Context, id string, zoneID string, tenantID string) (*domain.Record, error)
GetRecord implements ports.DNSRepository for testing.
func (*MockRepo) GetRecords ¶
func (m *MockRepo) GetRecords(_ context.Context, name string, qType domain.RecordType, clientIP string) ([]domain.Record, error)
GetRecords implements ports.DNSRepository for testing.
func (*MockRepo) GetRecordsByNames ¶
func (m *MockRepo) GetRecordsByNames(_ context.Context, names []string, qType domain.RecordType, clientIP string) (map[string][]domain.Record, error)
GetRecordsByNames implements ports.DNSRepository for testing.
func (*MockRepo) GetRecordsToProbeStreaming ¶
GetRecordsToProbeStreaming implements ports.DNSRepository for testing.
func (*MockRepo) GetZoneLongestMatch ¶
GetZoneLongestMatch implements ports.DNSRepository for testing.
func (*MockRepo) ListAPIKeys ¶
ListAPIKeys implements ports.DNSRepository for testing.
func (*MockRepo) ListKeysForZone ¶
ListKeysForZone implements ports.DNSRepository for testing.
func (*MockRepo) ListRecordsForZone ¶
func (m *MockRepo) ListRecordsForZone(_ context.Context, zoneID string, tenantID string) ([]domain.Record, error)
ListRecordsForZone implements ports.DNSRepository for testing.
func (*MockRepo) ListRecordsForZoneStreaming ¶
func (m *MockRepo) ListRecordsForZoneStreaming(_ context.Context, zoneID string, tenantID string) (ports.RecordIterator, error)
ListRecordsForZoneStreaming implements ports.DNSRepository for testing.
func (*MockRepo) ListZoneChanges ¶
func (m *MockRepo) ListZoneChanges(_ context.Context, zoneID string, fromSerial uint32) ([]domain.ZoneChange, error)
ListZoneChanges implements ports.DNSRepository for testing.
func (*MockRepo) RecordZoneChange ¶
RecordZoneChange implements ports.DNSRepository for testing.
func (*MockRepo) SaveAuditLog ¶
SaveAuditLog implements ports.DNSRepository for testing.
func (*MockRepo) UpdateRecord ¶
UpdateRecord implements ports.DNSRepository for testing.
func (*MockRepo) UpdateRecordHealth ¶
func (m *MockRepo) UpdateRecordHealth(ctx context.Context, recordID string, status domain.HealthStatus, errMsg string) error
UpdateRecordHealth implements ports.DNSRepository for testing.
type MockRoutingEngine ¶
type MockRoutingEngine struct {
Announced bool
WithdrawCount int
AnnounceAttempts int
WithdrawAttempts int
FailAnnounce bool
FailWithdraw bool
}
MockRoutingEngine implements ports.RoutingEngine for testing.
func (*MockRoutingEngine) Announce ¶
func (m *MockRoutingEngine) Announce(_ context.Context, _ string) error
Announce implements ports.RoutingEngine for testing.
func (*MockRoutingEngine) Stop ¶
func (m *MockRoutingEngine) Stop() error
Stop implements ports.RoutingEngine for testing.
type MockVIPManager ¶
MockVIPManager implements ports.VIPManager for testing.