本文へスキップ

Cloudflare Go

トレンド活発
cloudflare/cloudflare-go

Cloudflare API の公式 Go ライブラリ。DNS レコード、ゾーン、Workers、R2 などの Cloudflare リソースを Go のコードから管理できます。

GitHub で見る
スター
2099
フォーク
779
ウォッチ
2099
未解決の Issue
10

この紹介文は現在英語版のみです。

Cloudflare Go is the official Go client library for the Cloudflare API. It provides comprehensive support for all Cloudflare services including DNS, Firewall, Load Balancing, Workers, and more.

Key Features

  • Complete Cloudflare API coverage
  • Type-safe API calls
  • Automatic retries and error handling
  • Support for pagination and concurrent requests
  • Comprehensive documentation and examples

Quick Start

package main

import (
    "context"
    "fmt"
    "log"
    "os"

    "github.com/cloudflare/cloudflare-go"
)

func main() {
    // Create API client
    api, err := cloudflare.New(os.Getenv("CF_API_KEY"), os.Getenv("CF_API_EMAIL"))
    if err != nil {
        log.Fatal(err)
    }

    // Get account information
    ctx := context.Background()
    accounts, err := api.Accounts(ctx)
    if err != nil {
        log.Fatal(err)
    }

    // Print account information
    for _, account := range accounts {
        fmt.Printf("%s: %s\n", account.ID, account.Name)
    }
}

Installation

go get github.com/cloudflare/cloudflare-go

Documentation

For complete API documentation, please refer to the Cloudflare API Documentation.

Contributing

Pull requests and issues are welcome. Before submitting, please ensure:

  1. Code follows Go standard formatting
  2. Necessary tests are added
  3. Documentation is updated accordingly

License

This project is licensed under the Apache License 2.0.

共通のカテゴリとタグで順位付けした、似たオープンソースプロジェクトです。

すべての SDK プロジェクト →