cloudflare

package module
v0.0.0-...-f1246e0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudflareConfig

type CloudflareConfig struct {
	sync.RWMutex

	Token   string `toml:"api_token"`
	BaseURL string `toml:"base_url"`

	RatelimitConfiguration RatelimitConfiguration `toml:"ratelimit"`
	// contains filtered or unexported fields
}

func (*CloudflareConfig) CreateClient

func (c *CloudflareConfig) CreateClient() (*cloudflare.API, error)

func (*CloudflareConfig) GetClient

func (c *CloudflareConfig) GetClient() (cloudflare.API, error)

Initialize Metrics + Tracing for the app. NOTE: you must call defer t.Stop() to propely cleanup

func (*CloudflareConfig) Merge

func (c *CloudflareConfig) Merge(other *CloudflareConfig) error

func (*CloudflareConfig) RegisterFlags

func (c *CloudflareConfig) RegisterFlags(f *flag.FlagSet)

func (*CloudflareConfig) Validate

func (c *CloudflareConfig) Validate() error

type RatelimitConfiguration

type RatelimitConfiguration struct {
	RequestsPerSecond float64      `toml:"requests_per_second"`
	RetryPolicy       *RetryPolicy `toml:"retry_policy"`
}

type RetryPolicy

type RetryPolicy struct {
	MaxRetries    int `toml:"max_retries"`
	MinRetryDelay int `toml:"min_retry_delay"`
	MaxRetryDelay int `toml:"MaxRetryDelay"`
}

Jump to

Keyboard shortcuts

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