provider

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAliyunClient

func NewAliyunClient(secretID, secretKey string) (*alidns.Client, error)

NewAliyunClient 初始化客户端

func NewAwsDnsClient added in v0.1.4

func NewAwsDnsClient(secretID string, secretKey string) *route53.Client

func NewAwsDomainClient added in v0.1.4

func NewAwsDomainClient(secretID string, secretKey string) *route53domains.Client

func NewCloudflareDNSClient added in v0.1.5

func NewCloudflareDNSClient(token string, email string) (*cloudflare.API, error)

func NewDNSLaClient added in v0.1.4

func NewDNSLaClient(secretID, secretKey string) (*dnsla.Client, error)

NewDNSLaClient 初始化客户端

func NewGodaddyClient added in v0.1.2

func NewGodaddyClient(secretID, secretKey string) (*daddy.Client, error)

NewGodaddyClient 初始化客户端

func NewTencentClient

func NewTencentClient(secretID, secretKey string) (*dnspod.Client, error)

NewTencentClient 初始化客户端

Types

type AliyunDNS

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

func NewAliyunDNS

func NewAliyunDNS(account public.Account) (*AliyunDNS, error)

NewAliyunDNS 创建实例

func (*AliyunDNS) ListDomains

func (a *AliyunDNS) ListDomains() ([]Domain, error)

ListDomains 获取域名列表

func (*AliyunDNS) ListRecords

func (a *AliyunDNS) ListRecords() ([]Record, error)

ListRecords 获取记录列表

type AmazonDNS added in v0.1.4

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

func NewAwsDns added in v0.1.4

func NewAwsDns(account public.Account) *AmazonDNS

func (*AmazonDNS) ListDomains added in v0.1.4

func (a *AmazonDNS) ListDomains() ([]Domain, error)

func (*AmazonDNS) ListRecords added in v0.1.4

func (a *AmazonDNS) ListRecords() ([]Record, error)

type CloudFlareDNS added in v0.1.5

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

func NewCloudFlareDNS added in v0.1.5

func NewCloudFlareDNS(account public.Account) *CloudFlareDNS

func (*CloudFlareDNS) ListDomains added in v0.1.5

func (cf *CloudFlareDNS) ListDomains() ([]Domain, error)

func (*CloudFlareDNS) ListRecords added in v0.1.5

func (cf *CloudFlareDNS) ListRecords() ([]Record, error)

type DNSLaDNS added in v0.1.4

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

func NewDNSLaDNS added in v0.1.4

func NewDNSLaDNS(account public.Account) (*DNSLaDNS, error)

NewDNSLaDNS 创建 DNSLaDNS 实例

func (*DNSLaDNS) ListDomains added in v0.1.4

func (d *DNSLaDNS) ListDomains() ([]Domain, error)

ListDomains 获取域名列表

func (*DNSLaDNS) ListRecords added in v0.1.4

func (d *DNSLaDNS) ListRecords() ([]Record, error)

ListRecords 获取记录列表

type DNSProvider

type DNSProvider interface {
	ListDomains() ([]Domain, error)
	ListRecords() ([]Record, error)
}

DNSProvider 接口定义

type DNSProviderFactory

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

DNSProviderFactory 用于注册和创建 DNSProvider 实例

var Factory *DNSProviderFactory

func NewDNSProviderFactory

func NewDNSProviderFactory() *DNSProviderFactory

func (*DNSProviderFactory) Create

func (f *DNSProviderFactory) Create(cloudProvider string, account map[string]string) (DNSProvider, error)

Create 创建 DNSProvider 实例

func (*DNSProviderFactory) Register

func (f *DNSProviderFactory) Register(cloudProvider string, factoryFunc func(account map[string]string) DNSProvider)

Register 注册 DNSProvider 实现

type Domain

type Domain struct {
	CloudProvider   string `json:"cloud_provider"`
	CloudName       string `json:"cloud_name"`
	DomainID        string `json:"domain_id"`
	DomainName      string `json:"domain_name"`
	DomainRemark    string `json:"domain_remark"`
	DomainStatus    string `json:"domain_status"`
	CreatedDate     string `json:"created_date"`
	ExpiryDate      string `json:"expiry_date"`
	DaysUntilExpiry int64  `json:"days_until_expiry"`
}

Doamin 域名信息

type GetRecordCertReq

type GetRecordCertReq struct {
	CloudProvider string `json:"cloud_provider"`
	CloudName     string `json:"cloud_name"`
	DomainName    string `json:"domain_name"`
	FullRecord    string `json:"full_record"`
	RecordValue   string `json:"record_value"`
	RecordID      string `json:"record_id"`
}

type GodaddyDNS added in v0.1.2

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

func NewGodaddyDNS added in v0.1.2

func NewGodaddyDNS(account public.Account) (*GodaddyDNS, error)

NewGodaddyDNS 创建 GodaddyDNS 实例

func (*GodaddyDNS) ListDomains added in v0.1.2

func (g *GodaddyDNS) ListDomains() ([]Domain, error)

ListDomains 获取域名列表

func (*GodaddyDNS) ListRecords added in v0.1.2

func (g *GodaddyDNS) ListRecords() ([]Record, error)

ListRecords 获取记录列表

type Header struct {
	XAuthEmail  interface{} `json:"X-Auth-Email"`
	XAuthKey    interface{} `json:"X-Auth-Key"`
	ContentType string      `json:"Content-Type"`
}

type Record

type Record struct {
	CloudProvider string `json:"cloud_provider"`
	CloudName     string `json:"cloud_name"`
	DomainName    string `json:"domain_name"`
	RecordID      string `json:"record_id"`
	RecordType    string `json:"record_type"`
	RecordName    string `json:"record_name"`
	RecordValue   string `json:"record_value"`
	RecordTTL     string `json:"record_ttl"`
	RecordWeight  string `json:"record_weight"`
	RecordStatus  string `json:"record_status"`
	RecordRemark  string `json:"record_remark"`
	UpdateTime    string `json:"update_time"`
	FullRecord    string `json:"full_record"` // 完整记录 = Name + Value
}

Record 域名记录信息

type RecordCert

type RecordCert struct {
	CloudProvider             string `json:"cloud_provider"`
	CloudName                 string `json:"cloud_name"`
	DomainName                string `json:"domain_name"`                 // 域名
	FullRecord                string `json:"full_record"`                 // 完整记录 = Name + Value
	RecordID                  string `json:"record_id"`                   // 记录ID
	SubjectCommonName         string `json:"subject_common_name"`         // 颁发对象的公用名
	SubjectOrganization       string `json:"subject_organization"`        // 颁发对象的组织
	SubjectOrganizationalUnit string `json:"subject_organizational_unit"` // 颁发对象的组织单位
	IssuerCommonName          string `json:"issuer_common_name"`          // 颁发者的公用名
	IssuerOrganization        string `json:"issuer_organization"`         // 颁发者的组织
	IssuerOrganizationalUnit  string `json:"issuer_organizational_unit"`  // 颁发者的组织单位
	CreatedDate               string `json:"created_date"`                // 创建日期
	ExpiryDate                string `json:"expiry_date"`                 // 过期日期
	DaysUntilExpiry           int    `json:"days_until_expiry"`           // 距离到期日期还有多少天
	CertMatched               bool   `json:"cert_matched"`                // 证书是否匹配
	ErrorMsg                  string `json:"error_msg"`
}

RecordCert 域名证书信息

type RecordType added in v0.1.4

type RecordType int

RecordType 表示DNS记录类型

const (
	A          RecordType = 1
	NS         RecordType = 2
	CNAME      RecordType = 5
	MX         RecordType = 15
	TXT        RecordType = 16
	AAAA       RecordType = 28
	SRV        RecordType = 33
	CAA        RecordType = 257
	URLForward RecordType = 256
)

定义常量

type TencentCloudDNS

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

func NewTencentCloudDNS

func NewTencentCloudDNS(account public.Account) (*TencentCloudDNS, error)

NewTencentCloudDNS 创建 TencentCloudDNS 实例

func (*TencentCloudDNS) ListDomains

func (t *TencentCloudDNS) ListDomains() ([]Domain, error)

ListDomains 获取域名列表

func (*TencentCloudDNS) ListRecords

func (t *TencentCloudDNS) ListRecords() ([]Record, error)

ListRecords 获取记录列表

Jump to

Keyboard shortcuts

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