cloudflare

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: Unlicense Imports: 6 Imported by: 0

Documentation

Overview

Package cloudflare consumes the Cloudflare API (https://api.cloudflare.com/).

Index

Constants

View Source
const ConfigFilename = "cloudflare.json"

ConfigFilename defines the default filename for Cloudflare API Config files.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIKey string // API key generated on the "My Account" page
	Email  string // Email address associated with Cloudflare account
}

A Config for the Cloudflare API.

func ReadConfig

func ReadConfig(filename string) (*Config, error)

ReadConfig from filename.

func (*Config) Write

func (c *Config) Write(filename string) error

Write config to filename.

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session for the Cloudflare API.

func New

func New(apiKey, email string) (*Session, error)

New opens a new Cloudflare API session.

func NewWithConfig

func NewWithConfig(c *Config) (*Session, error)

NewWithConfig opens a new Cloudflare API session with parameters from config.

func (*Session) TXTCreate

func (s *Session) TXTCreate(zone, fqdn, txtdata string, ttl int) (string, error)

TXTCreate creates a TXT record.

func (*Session) TXTDelete

func (s *Session) TXTDelete(zone, fqdn string) error

TXTDelete deletes all TXT records.

func (*Session) TXTUpdate

func (s *Session) TXTUpdate(zone, fqdn, txtdata string, ttl int) error

TXTUpdate updates a TXT record.

Jump to

Keyboard shortcuts

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