zones

package
v0.0.0-...-be1e11a Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateObservation

func GenerateObservation(in cloudflare.Zone) v1alpha1.ZoneObservation

GenerateObservation creates an observation of a cloudflare Zone

func GetChangedSettings

func GetChangedSettings(czs, dzs *v1alpha1.ZoneSettings) []cloudflare.ZoneSetting

GetChangedSettings builds a map of only the settings whose values need to be updated.

func IsZoneNotFound

func IsZoneNotFound(err error) bool

IsZoneNotFound returns true if the passed error indicates a Zone was not found.

func LateInitialize

func LateInitialize(spec *v1alpha1.ZoneParameters, z cloudflare.Zone,
	ozs *v1alpha1.ZoneSettings) bool

LateInitialize initializes ZoneParameters based on the remote resource

func LateInitializeSettings

func LateInitializeSettings(observed, desired ZoneSettingsMap, initOn *v1alpha1.ZoneSettings) bool

LateInitializeSettings initializes Settings based on the remote resource

func LoadSettingsForZone

func LoadSettingsForZone(ctx context.Context,
	client Client, zoneID string, zs *v1alpha1.ZoneSettings) error

LoadSettingsForZone loads Zone settings from the cloudflare API and returns a ZoneSettingsMap.

func UpToDate

func UpToDate(spec *v1alpha1.ZoneParameters, z cloudflare.Zone, ozs *v1alpha1.ZoneSettings) bool

UpToDate checks if the remote resource is up to date with the requested resource parameters.

func UpdateZone

func UpdateZone(ctx context.Context, client Client, zoneID string, spec v1alpha1.ZoneParameters) error

UpdateZone updates mutable values on a Zone

Types

type Client

type Client interface {
	CreateZone(ctx context.Context, name string, jumpstart bool, account cloudflare.Account, zoneType string) (cloudflare.Zone, error)
	DeleteZone(ctx context.Context, zoneID string) (cloudflare.ZoneID, error)
	EditZone(ctx context.Context, zoneID string, zoneOpts cloudflare.ZoneOptions) (cloudflare.Zone, error)
	UpdateZoneSettings(ctx context.Context, zoneID string, cs []cloudflare.ZoneSetting) (*cloudflare.ZoneSettingResponse, error)
	ZoneDetails(ctx context.Context, zoneID string) (cloudflare.Zone, error)
	ZoneIDByName(zoneName string) (string, error)
	ZoneSetPlan(ctx context.Context, zoneID string, planType string) error
	ZoneSettings(ctx context.Context, zoneID string) (*cloudflare.ZoneSettingResponse, error)
}

Client is a Cloudflare API client that implements methods for working with Zones.

func NewClient

func NewClient(cfg clients.Config, hc *http.Client) (Client, error)

NewClient returns a new Cloudflare API client for working with Zones.

type ZoneSettingsMap

type ZoneSettingsMap map[string]interface{}

ZoneSettingsMap contains pairs of keys and values that represent settings on a Zone.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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