dns

package
v0.52.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer interface {
	Analyze(*cmv1.Cluster, []VerifyResult) DNSVerificationReport
}

type ClusterInfo

type ClusterInfo struct {
	Name   string `json:"name"`
	ID     string `json:"id"`
	Region string `json:"region"`
}

type DNSVerificationReport

type DNSVerificationReport struct {
	Cluster         ClusterInfo    `json:"cluster"`
	Results         []VerifyResult `json:"results"`
	Summary         summaryStats   `json:"summary"`
	Recommendations []string       `json:"recommendations,omitempty"`
}

type DefaultAnalyzer

type DefaultAnalyzer struct {
	// contains filtered or unexported fields
}

func NewDefaultAnalyzer

func NewDefaultAnalyzer(opts ...DefaultAnalyzerOption) *DefaultAnalyzer

func (*DefaultAnalyzer) Analyze

func (a *DefaultAnalyzer) Analyze(cluster *cmv1.Cluster, results []VerifyResult) DNSVerificationReport

type DefaultAnalyzerConfig

type DefaultAnalyzerConfig struct {
	Recommender Recommender
}

func (*DefaultAnalyzerConfig) Default

func (c *DefaultAnalyzerConfig) Default()

func (*DefaultAnalyzerConfig) Option

func (c *DefaultAnalyzerConfig) Option(opts ...DefaultAnalyzerOption)

type DefaultAnalyzerOption

type DefaultAnalyzerOption interface {
	ConfigureDefaultAnalyzer(*DefaultAnalyzerConfig)
}

type DefaultVerifier

type DefaultVerifier struct {
	// contains filtered or unexported fields
}

func NewDefaultVerifier

func NewDefaultVerifier(opts ...DefaultVerifierOption) *DefaultVerifier

func (*DefaultVerifier) VerifyARecord

func (v *DefaultVerifier) VerifyARecord(ctx context.Context, path string) VerifyResult

VerifyARecord tests an A record and returns the result

func (*DefaultVerifier) VerifyCNAMERecord

func (v *DefaultVerifier) VerifyCNAMERecord(ctx context.Context, dnsName string, opts ...VerifyCNAMERecordOption) VerifyResult

VerifyCNAMERecord tests a CNAME record and validates it points to the expected target

type DefaultVerifierConfig

type DefaultVerifierConfig struct {
	Timeout  time.Duration
	Resolver Resolver
}

func (*DefaultVerifierConfig) Default

func (c *DefaultVerifierConfig) Default()

func (*DefaultVerifierConfig) Option

func (c *DefaultVerifierConfig) Option(opts ...DefaultVerifierOption)

type DefaultVerifierOption

type DefaultVerifierOption interface {
	ConfigureDefaultVerifier(*DefaultVerifierConfig)
}

type MakeRecommendationsConfig

type MakeRecommendationsConfig struct {
	Cluster *cmv1.Cluster
}

func (*MakeRecommendationsConfig) Option

type MakeRecommendationsOption

type MakeRecommendationsOption interface {
	ConfigureMakeRecommendations(*MakeRecommendationsConfig)
}

type NoopRecommender

type NoopRecommender struct{}

func (*NoopRecommender) MakeRecommendations

func (r *NoopRecommender) MakeRecommendations([]VerifyResult, ...MakeRecommendationsOption) []string

type Recommender

type Recommender interface {
	MakeRecommendations([]VerifyResult, ...MakeRecommendationsOption) []string
}

type RecordType

type RecordType string
const (
	RecordTypeA     RecordType = "A"
	RecordTypeCNAME RecordType = "CNAME"
)

type Resolver

type Resolver interface {
	LookupHost(ctx context.Context, host string) ([]string, error)
	LookupCNAME(ctx context.Context, name string) (string, error)
}

type Verifier

type Verifier interface {
	VerifyARecord(context.Context, string) VerifyResult
	VerifyCNAMERecord(context.Context, string, ...VerifyCNAMERecordOption) VerifyResult
}

type VerifyCNAMERecordConfig

type VerifyCNAMERecordConfig struct {
	ExpectedTarget string
}

func (*VerifyCNAMERecordConfig) Option

type VerifyCNAMERecordOption

type VerifyCNAMERecordOption interface {
	ConfigureVerifyCNAMERecord(*VerifyCNAMERecordConfig)
}

type VerifyResult

type VerifyResult struct {
	Name           string             `json:"name"`
	Type           RecordType         `json:"type"`
	ResolvedIPs    []string           `json:"resolved_ips,omitempty"`    // For A records
	ActualTarget   string             `json:"actual_target,omitempty"`   // For CNAME records (actual)
	ExpectedTarget string             `json:"expected_target,omitempty"` // For CNAME records (expected)
	Status         VerifyResultStatus `json:"status"`                    // "PASS", "FAIL", or "SKIP"
	ErrorMessage   string             `json:"error_message,omitempty"`
	SkipReason     string             `json:"skip_reason,omitempty"` // Explanation for skipped records
}

type VerifyResultStatus

type VerifyResultStatus string
const (
	VerifyResultStatusPass VerifyResultStatus = "PASS"
	VerifyResultStatusFail VerifyResultStatus = "FAIL"
	VerifyResultStatusSkip VerifyResultStatus = "SKIP"
)

type WithCluster

type WithCluster struct {
	Cluster *cmv1.Cluster
}

func (WithCluster) ConfigureMakeRecommendations

func (w WithCluster) ConfigureMakeRecommendations(cfg *MakeRecommendationsConfig)

type WithExpectedTarget

type WithExpectedTarget string

func (WithExpectedTarget) ConfigureVerifyCNAMERecord

func (w WithExpectedTarget) ConfigureVerifyCNAMERecord(cfg *VerifyCNAMERecordConfig)

type WithRecommender

type WithRecommender struct {
	Recommender Recommender
}

func (WithRecommender) ConfigureDefaultAnalyzer

func (w WithRecommender) ConfigureDefaultAnalyzer(cfg *DefaultAnalyzerConfig)

type WithTimeout

type WithTimeout time.Duration

func (WithTimeout) ConfigureDefaultVerifier

func (w WithTimeout) ConfigureDefaultVerifier(cfg *DefaultVerifierConfig)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL