GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tc80/cloudflare-go: Go library for the Cloudflare v4 API

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

3,022 Commits
3,022 Commits

Folders and files

NameName
Last commit message
Last commit date
.changelog
.changelog
 
 
.devcontainer
.devcontainer
 
 
.github
.github
 
 
cmd/flarectl
cmd/flarectl
 
 
docs
docs
 
 
internal/tools
internal/tools
 
 
scripts
scripts
 
 
testdata/fixtures
testdata/fixtures
 
 
.gitignore
.gitignore
 
 
.golintci.yaml
.golintci.yaml
 
 
.semgrep.yml
.semgrep.yml
 
 
.semgrepignore
.semgrepignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
access_application.go
access_application.go
 
 
access_application_test.go
access_application_test.go
 
 
access_audit_log.go
access_audit_log.go
 
 
access_audit_log_example_test.go
access_audit_log_example_test.go
 
 
access_audit_log_test.go
access_audit_log_test.go
 
 
access_bookmark.go
access_bookmark.go
 
 
access_bookmark_test.go
access_bookmark_test.go
 
 
access_ca_certificate.go
access_ca_certificate.go
 
 
access_ca_certificate_test.go
access_ca_certificate_test.go
 
 
access_custom_page.go
access_custom_page.go
 
 
access_custom_page_test.go
access_custom_page_test.go
 
 
access_group.go
access_group.go
 
 
access_group_test.go
access_group_test.go
 
 
access_identity_provider.go
access_identity_provider.go
 
 
access_identity_provider_test.go
access_identity_provider_test.go
 
 
access_keys.go
access_keys.go
 
 
access_keys_test.go
access_keys_test.go
 
 
access_mutual_tls_certificates.go
access_mutual_tls_certificates.go
 
 
access_mutual_tls_certificates_test.go
access_mutual_tls_certificates_test.go
 
 
access_organization.go
access_organization.go
 
 
access_organization_test.go
access_organization_test.go
 
 
access_policy.go
access_policy.go
 
 
access_policy_test.go
access_policy_test.go
 
 
access_service_tokens.go
access_service_tokens.go
 
 
access_service_tokens_test.go
access_service_tokens_test.go
 
 
access_tag.go
access_tag.go
 
 
access_tag_test.go
access_tag_test.go
 
 
access_user_tokens.go
access_user_tokens.go
 
 
access_user_tokens_test.go
access_user_tokens_test.go
 
 
account_members.go
account_members.go
 
 
account_members_test.go
account_members_test.go
 
 
account_roles.go
account_roles.go
 
 
account_roles_test.go
account_roles_test.go
 
 
accounts.go
accounts.go
 
 
accounts_test.go
accounts_test.go
 
 
addressing_address_map.go
addressing_address_map.go
 
 
addressing_address_map_test.go
addressing_address_map_test.go
 
 
addressing_ip_prefix.go
addressing_ip_prefix.go
 
 
addressing_ip_prefix_test.go
addressing_ip_prefix_test.go
 
 
api_shield.go
api_shield.go
 
 
api_shield_operations.go
api_shield_operations.go
 
 
api_shield_operations_test.go
api_shield_operations_test.go
 
 
api_shield_schemas.go
api_shield_schemas.go
 
 
api_shield_schemas_test.go
api_shield_schemas_test.go
 
 
api_shield_test.go
api_shield_test.go
 
 
api_token.go
api_token.go
 
 
api_token_test.go
api_token_test.go
 
 
argo.go
argo.go
 
 
argo_example_test.go
argo_example_test.go
 
 
argo_test.go
argo_test.go
 
 
argo_tunnel.go
argo_tunnel.go
 
 
argo_tunnel_test.go
argo_tunnel_test.go
 
 
auditlogs.go
auditlogs.go
 
 
auditlogs_test.go
auditlogs_test.go
 
 
authenticated_origin_pulls.go
authenticated_origin_pulls.go
 
 
authenticated_origin_pulls_per_hostname.go
authenticated_origin_pulls_per_hostname.go
 
 
authenticated_origin_pulls_per_hostname_test.go
authenticated_origin_pulls_per_hostname_test.go
 
 
authenticated_origin_pulls_per_zone.go
authenticated_origin_pulls_per_zone.go
 
 
authenticated_origin_pulls_per_zone_test.go
authenticated_origin_pulls_per_zone_test.go
 
 
authenticated_origin_pulls_test.go
authenticated_origin_pulls_test.go
 
 
bot_management.go
bot_management.go
 
 
bot_management_test.go
bot_management_test.go
 
 
cache_reserve.go
cache_reserve.go
 
 
cache_reserve_test.go
cache_reserve_test.go
 
 
catalog.json
catalog.json
 
 
certificate_packs.go
certificate_packs.go
 
 
certificate_packs_test.go
certificate_packs_test.go
 
 
cloudflare.go
cloudflare.go
 
 
cloudflare_experimental.go
cloudflare_experimental.go
 
 
cloudflare_test.go
cloudflare_test.go
 
 
consts.go
consts.go
 
 
convert_types.go
convert_types.go
 
 
custom_hostname.go
custom_hostname.go
 
 
custom_hostname_test.go
custom_hostname_test.go
 
 
custom_nameservers.go
custom_nameservers.go
 
 
custom_nameservers_test.go
custom_nameservers_test.go
 
 
custom_pages.go
custom_pages.go
 
 
custom_pages_test.go
custom_pages_test.go
 
 
dcv_delegation.go
dcv_delegation.go
 
 
dcv_delegation_test.go
dcv_delegation_test.go
 
 
device_posture_rule.go
device_posture_rule.go
 
 
device_posture_rule_test.go
device_posture_rule_test.go
 
 
devices_dex.go
devices_dex.go
 
 
devices_dex_test.go
devices_dex_test.go
 
 

Repository files navigation

cloudflare-go

Go Reference Test 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.

Installation

You need a working Go environment. We officially support only currently supported Go versions according to Go project's release policy.

go get github.com/cloudflare/cloudflare-go

Getting Started

package main

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

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

func main() {
	// Construct a new API object using a global API key
	api, err := cloudflare.New(os.Getenv("CLOUDFLARE_API_KEY"), os.Getenv("CLOUDFLARE_API_EMAIL"))
	// alternatively, you can use a scoped API token
	// api, err := cloudflare.NewWithAPIToken(os.Getenv("CLOUDFLARE_API_TOKEN"))
	if err != nil {
		log.Fatal(err)
	}

	// Most API calls require a Context
	ctx := context.Background()

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

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

Experimental improvements

This library is starting to ship with experimental improvements that are not yet ready for production but will be introduced before the next major version. See experimental README for full details.

Contributing

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

License

BSD licensed. See the LICENSE file for details.

About

Go library for the Cloudflare v4 API

Resources

Readme
BSD-3-Clause license

Code of conduct

Code of conduct
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.