tencentcloud

package module
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: MIT Imports: 12 Imported by: 13

README

TencentCloud DNSPod for libdns

This package implements the libdns interfaces for the TencentCloud DNSPod API

Code example

import "github.com/libdns/tencentcloud"
provider := &tencentcloud.Provider{
    SecretId:  "YOUR_Secret_ID",
    SecretKey: "YOUR_Secret_Key",
}

Security Credentials

To authenticate you need to supply a TencentCloud API Key.

Other instructions

libdns/tencentcloud is based on the new version of Tencentcloud api, uses secret Id and key as authentication methods, supports permission settings, and supports DNSPod international version.

libdns/dnspod is based on the old version of dnspod.cn api, uses token as the authentication method, does not support permission settings, and does not support DNSPod international version.

Documentation

Index

Constants

View Source
const (
	DescribeRecordList = "DescribeRecordList"
	CreateRecord       = "CreateRecord"
	ModifyRecord       = "ModifyRecord"
	DeleteRecord       = "DeleteRecord"
)

Variables

View Source
var ErrNotValid = errors.New("returned value is not valid")
View Source
var ErrRecordNotFound = errors.New("record not found")

Functions

func SignRequest added in v1.3.1

func SignRequest(secretId string, secretKey string, r *http.Request, action string, payload string)

SignRequest https://github.com/jeessy2/ddns-go/blob/master/util/tencent_cloud_signer.go

Types

type CreateModifyRecordRequest added in v1.3.1

type CreateModifyRecordRequest struct {
	Domain     string `json:"Domain"`
	SubDomain  string `json:"SubDomain,omitempty"`
	RecordType string `json:"RecordType,omitempty"`
	RecordLine string `json:"RecordLine,omitempty"`
	Value      string `json:"Value,omitempty"`
	TTL        int64  `json:"TTL,omitempty"`
	RecordId   uint64 `json:"RecordId,omitempty"`
}

type DeleteRecordRequest added in v1.3.1

type DeleteRecordRequest struct {
	Domain   string `json:"Domain"`
	RecordId uint64 `json:"RecordId"`
}

type ErrorInfo added in v1.3.1

type ErrorInfo struct {
	Code    string `json:"Code"`
	Message string `json:"Message"`
}

type FindRecordRequest added in v1.3.1

type FindRecordRequest struct {
	Domain     string `json:"Domain"`
	RecordType string `json:"RecordType,omitempty"`
	RecordLine string `json:"RecordLine,omitempty"`
	Subdomain  string `json:"Subdomain,omitempty"`
	Limit      int64  `json:"Limit,omitempty"`
}

type Provider

type Provider struct {
	SecretId  string
	SecretKey string
}

func (*Provider) AppendRecords

func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

func (*Provider) DeleteRecords

func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

func (*Provider) GetRecords

func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)

func (*Provider) SetRecords

func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

type RecordInfo added in v1.3.1

type RecordInfo struct {
	RecordId int64  `json:"RecordId"`
	Type     string `json:"Type"`
	Name     string `json:"Name"`
	Value    string `json:"Value"`
	TTL      int64  `json:"TTL"`
}

type Response added in v1.3.1

type Response struct {
	Response ResponseData `json:"Response"`
}

type ResponseData added in v1.3.1

type ResponseData struct {
	RecordList []RecordInfo `json:"RecordList,omitempty"`
	RecordId   uint64       `json:"RecordId,omitempty"`
	Error      *ErrorInfo   `json:"Error,omitempty"`
}

Jump to

Keyboard shortcuts

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