quorum/vendor/github.com/cloudflare/cloudflare-go
Sai V c215989c10
Quorum geth upgrade to 1.9.7 (#960)
Co-authored-by: amalraj.manigmail.com <amalraj.manigmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Co-authored-by: Flash Sheridan <flash@pobox.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Nguyen Kien Trung <trung.n.k@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Rob Mulholand <rmulholand@8thlight.com>
Co-authored-by: Felföldi Zsolt <zsfelfoldi@gmail.com>
Co-authored-by: soc1c <soc1c@users.noreply.github.com>
Co-authored-by: Rafael Matias <rafael@skyle.net>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Lucas Hendren <lhendre2@gmail.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: ywzqwwt <39263032+ywzqwwt@users.noreply.github.com>
Co-authored-by: zcheng9 <zcheng9@hawk.iit.edu>
Co-authored-by: zzy96 <zhou0250@e.ntu.edu.sg>
Co-authored-by: kikilass <36239971+kikilass@users.noreply.github.com>
Co-authored-by: Darrel Herbst <dherbst@gmail.com>
Co-authored-by: Ross <9055337+Chadsr@users.noreply.github.com>
Co-authored-by: Jeffery Robert Walsh <rlxrlps@gmail.com>
Co-authored-by: Marius Kjærstad <sandakersmann@users.noreply.github.com>
Co-authored-by: Piotr Dyraga <piotr.dyraga@keep.network>
Co-authored-by: Guillaume Ballet <gballet@gmail.com>
Co-authored-by: Michael Forney <mforney@mforney.org>
Co-authored-by: Samuel Marks <807580+SamuelMarks@users.noreply.github.com>
2020-04-29 10:50:56 -04:00
..
CODE_OF_CONDUCT.md Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
LICENSE Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
README.md Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
access_application.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
access_identity_provider.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
access_organization.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
access_policy.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
access_service_tokens.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
account_members.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
account_roles.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
accounts.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
argo.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
auditlogs.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
cloudflare.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
custom_hostname.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
custom_pages.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
dns.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
duration.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
errors.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
filter.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
firewall.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
firewall_rules.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
go.mod Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
go.sum Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
ips.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
keyless.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
load_balancing.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
lockdown.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
logpush.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
options.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
origin_ca.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
page_rules.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
railgun.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
rate_limiting.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
registrar.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
renovate.json Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
spectrum.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
ssl.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
universal_ssl.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
user.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
user_agent.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
virtualdns.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
waf.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
workers.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
workers_kv.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00
zone.go Quorum geth upgrade to 1.9.7 (#960) 2020-04-29 10:50:56 -04:00

README.md

cloudflare-go

GoDoc Build Status Go Report Card

Note: This library is under active development as we expand it to cover our (expanding!) API. Consider the public API of this package a little unstable as we work towards a v1.0.

A Go library for interacting with Cloudflare's API v4. This library allows you to:

  • Manage and automate changes to your DNS records within Cloudflare
  • Manage and automate changes to your zones (domains) on Cloudflare, including adding new zones to your account
  • List and modify the status of WAF (Web Application Firewall) rules for your zones
  • Fetch Cloudflare's IP ranges for automating your firewall whitelisting

A command-line client, flarectl, is also available as part of this project.

Features

The current feature list includes:

  • Cache purging
  • Cloudflare IPs
  • Custom hostnames
  • DNS Records
  • Firewall (partial)
  • Keyless SSL
  • Load Balancing
  • Logpush Jobs
  • Organization Administration
  • Origin CA
  • Railgun administration
  • Rate Limiting
  • User Administration (partial)
  • Virtual DNS Management
  • Web Application Firewall (WAF)
  • Zone Lockdown and User-Agent Block rules
  • Zones

Pull Requests are welcome, but please open an issue (or comment in an existing issue) to discuss any non-trivial changes before submitting code.

Installation

You need a working Go environment.

go get github.com/cloudflare/cloudflare-go

Getting Started

package main

import (
	"fmt"
	"log"
	"os"

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

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

	// Fetch user details on the account
	u, err := api.UserDetails()
	if err != nil {
		log.Fatal(err)
	}
	// Print user details
	fmt.Println(u)

	// Fetch the zone ID
	id, err := api.ZoneIDByName("example.com") // Assuming example.com exists in your Cloudflare account already
	if err != nil {
		log.Fatal(err)
	}

	// Fetch zone details
	zone, err := api.ZoneDetails(id)
	if err != nil {
		log.Fatal(err)
	}
	// Print zone details
	fmt.Println(zone)
}

Also refer to the API documentation for how to use this package in-depth.

License

BSD licensed. See the LICENSE file for details.