huawei

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RecordTypeA     = "A"     // ipv4
	RecordTypeAAAA  = "AAAA"  // ipv6
	RecordTypeCNAME = "CNAME" // 域名
	RecordTypeMX    = "MX"    // 邮件
	RecordTypeTXT   = "TXT"   // 文本
	RecordTypeSRV   = "SRV"   // 服务
	RecordTypeNS    = "NS"    // 名称服务器
	RecordTypeCAA   = "CAA"   // 证书
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	AccessKey       string `json:"access_token"`
	SecretAccessKey string `json:"secret_access_key"`
	Domain          string `json:"domain"`
	ZoneId          string `json:"zone_id"`
}

func NewAuth

func NewAuth(accessKey, secretAccessKey, domain string) (*Auth, error)

func (*Auth) CreateRecord added in v0.0.3

func (a *Auth) CreateRecord(r Record) (model.CreateRecordSetResponse, error)

func (*Auth) DeleteRecord added in v0.0.3

func (a *Auth) DeleteRecord(id string) (model.DeleteRecordSetResponse, error)

func (*Auth) FindRecord added in v0.0.3

func (a *Auth) FindRecord(id string) (model.ShowRecordSetResponse, error)

func (*Auth) GetZones

func (a *Auth) GetZones() (dm.ShowPublicZoneResponse, error)

func (*Auth) RecordList added in v0.0.3

func (a *Auth) RecordList(Type ...string) (model.ListRecordSetsByZoneResponse, error)

func (*Auth) UpdateRecord added in v0.0.3

func (a *Auth) UpdateRecord(id string, r Record) (model.UpdateRecordSetResponse, error)

type Record added in v0.0.3

type Record struct {

	// 域名,后缀需以zone name结束且为FQDN(即以“.”号结束的完整主机名)。
	Name string `json:"name"`

	// 可选配置,对域名的描述。  长度不超过255个字符。  默认值为空。
	Description string `json:"description,omitempty"`

	// Record Set的类型。  公网域名场景的记录类型: A、AAAA、MX、CNAME、TXT、NS、SRV、CAA。  内网域名场景的记录类型: A、AAAA、MX、CNAME、TXT、SRV。
	Type string `json:"type"`

	// 资源状态。
	Status string `json:"status,omitempty"`

	// 解析记录在本地DNS服务器的缓存时间,缓存时间越长更新生效越慢,以秒为单位。 如果您的服务地址经常更换,建议TTL值设置相对小些,反之,建议设置相对大些。
	Ttl int32 `json:"ttl,omitempty"`

	// 解析记录的值。不同类型解析记录对应的值的规则不同。
	Records []string `json:"records"`

	// 资源标签。
	Tags []Tag `json:"tags,omitempty"`
}

type Tag added in v0.0.3

type Tag struct {

	// 键。最大长度36个unicode字符。 key不能为空。不能包含“=”,“*”,“<”,“>”,“\\”,“,”,“|”,“/”,且首尾字符不能为空格。
	Key string `json:"key"`

	// 值。每个值最大长度43个unicode字符,可以为空字符串。 不能包含“=”,“*”,“<”,“>”,“\\”,“,”,“|”,“/”,且首尾字符不能为空格。
	Value *string `json:"value,omitempty"`
}

Jump to

Keyboard shortcuts

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