Thanks to visit codestin.com
Credit goes to github.com

Skip to content

arvancloud/cdn-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArvanCloud CDN Go

logo

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.

Installation

go get github.com/arvancloud/cdn-go

Usage

package 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)
}

Features

  • 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

Contributing

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].

About

Go library for ArvanCloud CDN API

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •