edgeone

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: MIT Imports: 17 Imported by: 3

README

EdgeOne for libdns

This package implements the libdns interfaces for the EdgeOne API

Code example

import "github.com/libdns/edgeone"
provider := &edgeone.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/edgeone is based on the Edgeone DNS API, uses token as the authentication method, supports granular permission settings, and is designed for Edgeone global CDN integration.

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 (
	DescribeZones      = "DescribeZones"
	DescribeDnsRecords = "DescribeDnsRecords"
	CreateDnsRecord    = "CreateDnsRecord"
	ModifyDnsRecords   = "ModifyDnsRecords"
	DeleteDnsRecords   = "DeleteDnsRecords"
)

Variables

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

Functions

func TencentCloudSigner

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

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

Types

type CreateDnsRecordRequest

type CreateDnsRecordRequest struct {
	DnsRecord
}

type CreateDnsRecordResponse

type CreateDnsRecordResponse struct {
	Response struct {
		Error    *Error `json:"Error,omitempty"`
		RecordId string `json:"RecordId"`
	}
}

type DeleteDnsRecordsRequest

type DeleteDnsRecordsRequest struct {
	ZoneId    string   `json:"ZoneId"`
	RecordIds []string `json:"RecordIds"`
}

type DescribeDnsRecordsRequest

type DescribeDnsRecordsRequest struct {
	ZoneId  string   `json:"ZoneId"`
	Limit   int64    `json:"Limit,omitempty"`
	Filters []Filter `json:"Filters,omitempty"`
	SortBy  string   `json:"SortBy,omitempty"`
}

type DescribeDnsRecordsResponse

type DescribeDnsRecordsResponse struct {
	Response struct {
		Error      *Error      `json:"Error,omitempty"`
		DnsRecords []DnsRecord `json:"DnsRecords"`
	}
}

type DescribeZonesRequest

type DescribeZonesRequest struct {
	Filters []Filter `json:"Filters,omitempty"`
}

type DescribeZonesResponse

type DescribeZonesResponse struct {
	Response struct {
		Error *Error `json:"Error,omitempty"`
		Zones []struct {
			ZoneId string `json:"ZoneId"`
		} `json:"Zones"`
	}
}

type DnsRecord

type DnsRecord struct {
	Content  string `json:"Content"`
	Location string `json:"Location,omitempty"`
	Name     string `json:"Name"`
	Priority int64  `json:"Priority,omitempty"`
	RecordId string `json:"RecordId,omitempty"`
	Status   string `json:"Status,omitempty"`
	TTL      int64  `json:"TTL,omitempty"`
	Type     string `json:"Type"`
	Weight   int64  `json:"Weight,omitempty"`
	ZoneId   string `json:"ZoneId"`
}

type Error

type Error struct {
	Code    string
	Message string
}

type Filter

type Filter struct {
	Name   string   `json:"Name"`
	Values []string `json:"Values"`
	Fuzzy  bool     `json:"Fuzzy,omitempty"`
}

type ModifyDnsRecordsRequest

type ModifyDnsRecordsRequest struct {
	ZoneId     string      `json:"ZoneId"`
	DnsRecords []DnsRecord `json:"DnsRecords,omitempty"`
}

type Provider

type Provider struct {
	SecretId     string
	SecretKey    string
	SessionToken string
	Region       string
	// contains filtered or unexported fields
}

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 TimedValue

type TimedValue[T any] struct {
	Value     string
	UpdatedAt time.Time
}

Jump to

Keyboard shortcuts

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