rule

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRule

func CreateRule(ctx context.Context, client Client, spec *v1alpha1.RuleParameters) (*cloudflare.FirewallRule, error)

CreateRule creates a new Rule

func GenerateObservation

func GenerateObservation(in cloudflare.FirewallRule) v1alpha1.RuleObservation

GenerateObservation creates an observation of a cloudflare Rule

func IsRuleNotFound

func IsRuleNotFound(err error) bool

IsRuleNotFound returns true if the passed error indicates a Rule was not found.

func LateInitialize

func LateInitialize(spec *v1alpha1.RuleParameters, r cloudflare.FirewallRule) bool

LateInitialize initializes RuleParameters based on the remote resource

func UpToDate

func UpToDate(spec *v1alpha1.RuleParameters, r cloudflare.FirewallRule) bool

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

func UpdateRule

func UpdateRule(ctx context.Context, client Client, ruleID string, spec *v1alpha1.RuleParameters) error

UpdateRule updates mutable values on a Rule

Types

type Client

type Client interface {
	// Note there is no singular CreateRule in cloudflare-go
	CreateFirewallRules(ctx context.Context, zoneID string, firewallRules []cloudflare.FirewallRule) ([]cloudflare.FirewallRule, error)
	UpdateFirewallRule(ctx context.Context, zoneID string, firewallRule cloudflare.FirewallRule) (cloudflare.FirewallRule, error)
	DeleteFirewallRule(ctx context.Context, zoneID, firewallRuleID string) error
	FirewallRule(ctx context.Context, zoneID, firewallRuleID string) (cloudflare.FirewallRule, error)
}

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

func NewClient

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

NewClient returns a new Cloudflare API client for working with Firewall rules.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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