cdn-go

module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: MIT

README

ArvanCloud CDN Go

Release CodeQL Docker Image Size (latest semver)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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