cloudflare

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLOUDFLARE_PROVIDER_NAME         = "cloudflare"
	CLOUDFLARE_IMAGE_ENDPOINT_REGEX  = `^(https://imagedelivery\.net/[A-Za-z0-9_-]+/[A-Za-z0-9_-]+)(?:/([A-Za-z0-9_-]+))?$`
	CLOUDFLARE_STREAM_ENDPOINT_REGEX = `^(https://customer-[A-Za-z0-9]+\.cloudflarestream\.com/[A-Za-z0-9]+/manifest/video)\.(m3u8|mpd)$`
)

Variables

View Source
var (
	// Error Code: 5413
	ErrImageExceededMaxFileSize = errors.New("image exceeded max file size")

	// Error Code: 5443
	ErrAnimationTooLarge = errors.New("animation too large")

	// Error Code: 7011
	ErrRequestEntityTooLarge = errors.New("request entity too large")
)

Functions

func IsCloudflareImageURL added in v0.2.2

func IsCloudflareImageURL(url string) (bool, bool)

IsCloudflareImageURL checks if a URL is a Cloudflare Images URL It returns a boolean indicating if the URL is a Cloudflare Images URL and a boolean indicating if the URL has a variant

func NewMediaProvider

func NewMediaProvider(cfClient adapter.CloudflareClient, config *Config, dl downloader.Downloader, fs adapter.FileSystem) mediaprovider.Provider

NewMediaProvider creates a new Cloudflare Images and Stream provider

Types

type Config

type Config struct {
	// AccountID is the Cloudflare account ID for Images
	AccountID string
	// APIToken is the API token for authentication
	APIToken string
}

Config holds configuration for Cloudflare Images and Stream

Jump to

Keyboard shortcuts

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