internal

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupportedOperation = errors.New("不支持的操作")

Functions

This section is empty.

Types

type Api

type Api interface {
	Ping() (ok bool)                                                     // Ping
	LineList() (resp LineListResp)                                       // 线路列表
	LineDefault() (resp LineListRespLine)                                // 线路默认
	DomainList(req DomainListReq) (resp DomainListResp, err error)       // 域名列表
	DomainAdd(req DomainAddReq) (resp DomainAddResp, err error)          // 域名添加
	DomainDelete(req DomainDeleteReq) (err error)                        // 域名删除
	RecordList(req RecordListReq) (resp RecordListResp, err error)       // 记录列表
	RecordAdd(req RecordAddReq) (resp RecordAddResp, err error)          // 记录新增
	RecordUpdate(req RecordUpdateReq) (resp RecordUpdateResp, err error) // 记录修改
	RecordDelete(req RecordDeleteReq) (err error)                        // 记录删除
	RecordEnable(req RecordEnableReq) (err error)                        // 记录启用
	RecordDisable(req RecordDisableReq) (err error)                      // 记录暂停
}

func AlidnsApi

func AlidnsApi(client *alidns.Client) Api

func CloudflareApi

func CloudflareApi(cApi *cloudflare.API) Api

func DnspodApi

func DnspodApi(client *dnspod.Client) Api

func PqdnsApi

func PqdnsApi(baseUrl, username, secretKey string) Api

type DomainAddReq

type DomainAddReq struct {
	Domain string `json:"domain"` // 域名 => example.com
}

type DomainAddResp

type DomainAddResp struct {
	Id        string   `json:"id"`         // 域名id => xxxxxxxxxxxx
	DnsServer []string `json:"dns_server"` // DNS服务器 => [ns1.com, ns2.com]
}

type DomainDeleteReq

type DomainDeleteReq struct {
	Domain   string `json:"domain"`    // 域名 => example.com
	DomainId string `json:"domain_id"` // 域名Id => xxxxxxxxxxxx
}

type DomainDisableReq

type DomainDisableReq struct {
	Domain   string `json:"domain"`    // 域名 => example.com
	DomainId string `json:"domain_id"` // 域名Id => xxxxxxxxxxxx
}

type DomainEnableReq

type DomainEnableReq struct {
	Domain   string `json:"domain"`    // 域名 => example.com
	DomainId string `json:"domain_id"` // 域名Id => xxxxxxxxxxxx
}

type DomainListReq

type DomainListReq struct {
	Page   uint   `form:"page"`   // 页码 => 1
	Limit  uint   `form:"limit"`  // 每页数量 => 10
	Domain string `form:"domain"` // 域名 => example.com
}

type DomainListResp

type DomainListResp struct {
	Total uint                   `json:"total"`
	List  []DomainListRespDomain `json:"list"`
}

type DomainListRespDomain

type DomainListRespDomain struct {
	Id          string   `json:"id"`           // 域名id => xxxxxxxxxxxx
	Name        string   `json:"name"`         // 域名名称 => example.com
	DnsServer   []string `json:"dns_server"`   // DNS服务器 => [ns1.com, ns2.com]
	RecordCount uint     `json:"record_count"` // 记录数 => 100
	Remark      string   `json:"remark"`       // 备注
	CreateTime  string   `json:"create_time"`  // 创建时间 => 2022-09-27 08:09:25
}

type LineListResp

type LineListResp struct {
	List []LineListRespLine `json:"list"`
}

type LineListRespLine

type LineListRespLine struct {
	Id   string `json:"id"`   // 线路id
	Name string `json:"name"` // 线路名称
}

type RecordAddReq

type RecordAddReq struct {
	DomainId string `json:"domain_id"` // 域名Id => xxxxxxxxxxxx
	Domain   string `json:"domain"`    // 域名 => example.com
	Record   string `json:"record"`    // 主机记录 => www
	Type     string `json:"type"`      // 类型 => A
	Value    string `json:"value"`     // 记录值 => 1.1.1.1
	Line     string `json:"line"`      //  线路 => 0
	TTL      uint   `json:"ttl"`       // TTL => 60
	//	MX       uint   `json:"mx"`        // MX => only for mx type
	Weight uint   `json:"weight"` // 权重 => 100
	Remark string `json:"remark"` // 备注 => created by dnsdk
}

type RecordAddResp

type RecordAddResp struct{ RecordListRespRecord }

type RecordDeleteReq

type RecordDeleteReq struct {
	RecordId string `json:"record_id"` // 记录Id => xxxxxxxxxxxx
	DomainId string `json:"domain_id"` // 域名Id => xxxxxxxxxxxx
}

type RecordDisableReq

type RecordDisableReq RecordEnableReq

type RecordEnableReq

type RecordEnableReq struct {
	RecordId string `json:"record_id"` // 记录Id => xxxxxxxxxxxx
	DomainId string `json:"domain_id"` // 域名Id => xxxxxxxxxxxx
	Domain   string `json:"domain"`    // 域名 => example.com
}

type RecordListReq

type RecordListReq struct {
	Page      uint   `form:"page"`      // 页码 => 1
	Limit     uint   `form:"limit"`     // 每页数量 => 10
	DomainId  string `form:"domain_id"` // 域名Id => xxxxxxxxxxxx
	Domain    string `form:"domain"`    // 域名 => example.com
	Record    string `form:"record"`    // 主机记录 => www
	Type      string `form:"type"`      // 解析类型 => A
	Line      string `form:"line"`      // 线路id => default
	Value     string `form:"value"`     // 记录值 => 1.1.1.1
	Remark    string `form:"remark"`    // 备注 => created by dnsdk
	Order     string `form:"order"`     // 排序 => type
	Direction string `form:"direction"` // 方向 => asc / desc
}

type RecordListResp

type RecordListResp struct {
	Total uint                   `json:"total"`
	List  []RecordListRespRecord `json:"list"`
}

type RecordListRespRecord

type RecordListRespRecord struct {
	Id         string `json:"id"`          // id => xxxxxxxxxxxx
	Record     string `json:"record"`      // 主机记录 => www
	Name       string `json:"name"`        // 名称 => www.example.com
	Type       string `json:"type"`        // 类型 => A
	Value      string `json:"value"`       // 记录值 => 1.1.1.1
	Line       string `json:"line"`        // 线路 => default
	TTL        uint   `json:"ttl"`         // TTL => 60
	MX         uint16 `json:"mx"`          // MX => 1
	Weight     uint   `json:"weight"`      // 权重 => 5
	Remark     string `json:"remark"`      // 备注
	Status     string `json:"status"`      // 状态
	CreateTime string `json:"create_time"` // 创建时间 => 2022-09-27 08:09:25
	UpdateTime string `json:"update_time"` // 修改时间 => 2022-09-27 08:09:25
}

type RecordUpdateReq

type RecordUpdateReq struct {
	RecordId string `json:"record_id"` // 记录Id => xxxxxxxxxxxx
	DomainId string `json:"domain_id"` // 域名Id => xxxxxxxxxxxx
	Domain   string `json:"domain"`    // 域名 => example.com
	Record   string `json:"record"`    // 主机记录 => www
	Type     string `json:"type"`      // 类型 => A
	Value    string `json:"value"`     // 记录值 => 1.1.1.1
	Line     string `json:"line"`      //  线路 => 0
	TTL      uint   `json:"ttl"`       // TTL => 60
	//	MX       uint   `json:"mx"`        // MX => only for mx type
	Weight uint   `json:"weight"` // 权重 => 100
	Remark string `json:"remark"` // 备注 => created by dnsdk
}

type RecordUpdateResp

type RecordUpdateResp RecordAddResp

Jump to

Keyboard shortcuts

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