It's a Go library for interacting with the ArvanCloud CDN API.
Note: This project is under active development and may have problems and shortcomings.
go get github.com/arvancloud/cdn-gopackage main
import (
"context"
"fmt"
"log"
"os"
arvancloud "github.com/arvancloud/cdn-go/pkg"
)
func main() {
api, err := arvancloud.New(
os.Getenv("ARVANCLOUD_API_KEY"),
arvancloud.Debug(false),
)
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
resource := arvancloud.Resource{
Domain: "test.ir",
}
record := arvancloud.CreateDNSRecordParams{
Type: "A",
Name: "C",
Value: []arvancloud.DNSRecord_Value_A{
{
IP: "1.1.1.1",
},
},
TTL: 120,
UpstreamHTTPS: "default",
IPFilterMode: arvancloud.DNSRecord_IPFilterMode{
Count: "single",
Order: "none",
GeoFilter: "none",
},
}
u, err := api.CreateDNSRecord(ctx, resource, record)
if err != nil {
log.Fatal(err.Error())
}
fmt.Printf("%+v", u)
}- Products
- DNS
- Firewall
- WAF
- DDoS
- Cache
- Load Balancer
- Page Rule
- Acceleration
- Custom Pages
- Redirect
- Log Forwarder
- L4 Proxy
- Rate Limit
- Package
- CLI
- Documentation
- Official Release
- CI/CD
We welcome contributions from the community. Please consider that this project is under active development as we expand it to cover the CDN API.
Please report any issues you find in the Issues page or send us an email at [email protected].