https://github.com/libdns/westcn
West.cn provider for libdns
https://github.com/libdns/westcn
Last synced: 4 months ago
JSON representation
West.cn provider for libdns
- Host: GitHub
- URL: https://github.com/libdns/westcn
- Owner: libdns
- License: mit
- Created: 2025-04-01T15:27:57.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-11-02T09:19:26.000Z (7 months ago)
- Last Synced: 2025-11-02T11:37:17.379Z (7 months ago)
- Language: Go
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
West.cn for [`libdns`](https://github.com/libdns/libdns)
=======================
[](https://pkg.go.dev/github.com/libdns/westcn)
This package implements the [libdns interfaces](https://github.com/libdns/libdns) for [west.cn](https://west.cn), allowing you to manage DNS records.
## Authenticating
To authenticate you need to supply your Username and APIPassword to the Provider.
## Example
Here's a minimal example of how to get all your DNS records using this `libdns` provider
```go
package main
import (
"context"
"fmt"
"github.com/libdns/westcn"
)
func main() {
provider := westcn.Provider{
Username: "",
APIPassword: "",
}
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](_example/main.go)