dnsconfig

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 37 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dnsconfig 只创建授权的 CNAME,不修改或删除已有记录。

Index

Constants

This section is empty.

Variables

Definitions 是完整支持目录,注册和实际分发使用同一来源。

Functions

func Capabilities

func Capabilities(runtime *config.Runtime) []*deployPB.DnsProviderCapability

Capabilities 返回完整凭据是否存在,不进行云端调用。

func Classify

func Classify(entries []Entry, record *deployPB.DnsRecord) deployPB.DnsOperationStatus

Classify 在所有同名记录上执行保守冲突判断。

func Configuration

func Configuration(runtime *config.Runtime, name string) *config.Provider

Configuration 从运行期快照读取一项厂商配置。

func Normalize

func Normalize(value string) string

Normalize 将 DNS 名称规范化用于精确比较。

func Operate

func Operate(ctx context.Context, backend Backend, record *deployPB.DnsRecord, write bool) *deployPB.DnsOperationResult

Operate 在写入前重新查询,创建后回读,取消或超时不会触发盲目重试。

Types

type Backend

type Backend interface {
	// FindZone 精确读取权威托管区,禁止退回祖先区。
	FindZone(context.Context, string) (string, error)
	// List 查询同名全部类型和线路。
	List(context.Context, string, *deployPB.DnsRecord) ([]Entry, error)
	// Create 新增默认线路、TTL 600 的 CNAME。
	Create(context.Context, string, *deployPB.DnsRecord) (string, error)
}

Backend 是厂商 DNS API 的最小接口,所有查询必须覆盖分页。

func NewBackend

func NewBackend(runtime *config.Runtime, provider deployPB.DnsProvider) (Backend, error)

NewBackend 构造与本地凭据对应的 DNS 适配器,不调用其他云产品。

type Definition

type Definition struct {
	Provider   deployPB.DnsProvider                    // Provider 是协议枚举。
	Name       string                                  // Name 是展示名称。
	ConfigName string                                  // ConfigName 是现有 provider 配置名。
	New        func(*config.Provider) (Backend, error) // New 仅构造 DNS 客户端。
}

Definition 描述支持的 DNS 厂商与本地配置名称。

type Entry

type Entry struct {
	Host        string // Host 是相对主机记录或完整记录名。
	Type        string // Type 是 DNS 类型。
	Value       string // Value 是记录内容。
	Enabled     bool   // Enabled 表示当前记录有效。
	DefaultLine bool   // DefaultLine 表示默认线路。
}

Entry 是适配器查询出的精确记录,保留停用和特殊线路状态。

Jump to

Keyboard shortcuts

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