Skip to content

libdns/huaweicloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

07e962a · Apr 3, 2025

History

24 Commits
Oct 18, 2024
Oct 18, 2024
Nov 29, 2024
Oct 18, 2024
Mar 29, 2025
Apr 3, 2025
Apr 1, 2025
Apr 1, 2025
Apr 3, 2025
Nov 29, 2024
Nov 29, 2024

Repository files navigation

Huawei Cloud for libdns

Go Reference

This package implements the libdns interfaces for Huawei Cloud DNS, allowing you to manage DNS records.

Authenticating

To authenticate you need to supply your AccessKeyId and SecretAccessKey to the Provider.

Example

Here's a minimal example of how to get all your DNS records using this libdns provider

package main

import (
	"context"
	"fmt"

	"github.com/libdns/huaweicloud"
)

func main() {
	provider := huaweicloud.Provider{
		AccessKeyId: "<AccessKeyId form your huaweicloud console>",
		SecretAccessKey: "<SecretAccessKey form your huaweicloud console>",
	}

	records, err  := provider.GetRecords(context.TODO(), "example.com.")
	if err != nil {
		fmt.Println(err.Error())
	}

	for _, record := range records {
		fmt.Printf("%s %v %s %s\n", record.Name, record.TTL.Seconds(), record.Type, record.Value)
	}
}

For complete demo check _example/main.go