Documentation
¶
Index ¶
- Constants
- type ASN
- type ASNParam
- type AuditLog
- type AuditLogAction
- type AuditLogActor
- type AuditLogActorType
- type AuditLogOwner
- type AuditLogResource
- type BrowserRenderingService
- type CertificateCA
- type CertificateRequestType
- type CloudflareTunnel
- type CloudflareTunnelConnection
- type CloudflareTunnelStatus
- type CloudflareTunnelTunType
- type ContentNewParams
- type ContentNewParamsAddScriptTag
- type ContentNewParamsAddStyleTag
- type ContentNewParamsAllowResourceType
- type ContentNewParamsAuthenticate
- type ContentNewParamsCookie
- type ContentNewParamsCookiesPriority
- type ContentNewParamsCookiesSameSite
- type ContentNewParamsCookiesSourceScheme
- type ContentNewParamsGotoOptions
- type ContentNewParamsGotoOptionsWaitUntilArray
- type ContentNewParamsGotoOptionsWaitUntilArrayItem
- type ContentNewParamsGotoOptionsWaitUntilString
- type ContentNewParamsGotoOptionsWaitUntilUnion
- type ContentNewParamsRejectResourceType
- type ContentNewParamsViewport
- type ContentNewParamsWaitForSelector
- type ContentNewParamsWaitForSelectorHidden
- type ContentNewParamsWaitForSelectorVisible
- type ContentNewResponseEnvelope
- type ContentNewResponseEnvelopeErrors
- type ContentService
- type Error
- type ErrorData
- type ErrorDataSource
- type Member
- type MemberPoliciesAccess
- type MemberPoliciesPermissionGroup
- type MemberPoliciesPermissionGroupsMeta
- type MemberPoliciesResourceGroup
- type MemberPoliciesResourceGroupsMeta
- type MemberPoliciesResourceGroupsScope
- type MemberPoliciesResourceGroupsScopeObject
- type MemberPolicy
- type MemberStatus
- type MemberUser
- type PDFNewParams
- type PDFNewParamsAddScriptTag
- type PDFNewParamsAddStyleTag
- type PDFNewParamsAllowResourceType
- type PDFNewParamsAuthenticate
- type PDFNewParamsCookie
- type PDFNewParamsCookiesPriority
- type PDFNewParamsCookiesSameSite
- type PDFNewParamsCookiesSourceScheme
- type PDFNewParamsGotoOptions
- type PDFNewParamsGotoOptionsWaitUntilArray
- type PDFNewParamsGotoOptionsWaitUntilArrayItem
- type PDFNewParamsGotoOptionsWaitUntilString
- type PDFNewParamsGotoOptionsWaitUntilUnion
- type PDFNewParamsRejectResourceType
- type PDFNewParamsViewport
- type PDFNewParamsWaitForSelector
- type PDFNewParamsWaitForSelectorHidden
- type PDFNewParamsWaitForSelectorVisible
- type PDFService
- type Permission
- type PermissionGrant
- type PermissionGrantParam
- type RatePlan
- type RatePlanID
- type RatePlanParam
- type ResponseInfo
- type Role
- type RoleParam
- type RolePermissions
- type RolePermissionsParam
- type ScrapeNewParams
- type ScrapeNewParamsAddScriptTag
- type ScrapeNewParamsAddStyleTag
- type ScrapeNewParamsAllowResourceType
- type ScrapeNewParamsAuthenticate
- type ScrapeNewParamsCookie
- type ScrapeNewParamsCookiesPriority
- type ScrapeNewParamsCookiesSameSite
- type ScrapeNewParamsCookiesSourceScheme
- type ScrapeNewParamsElement
- type ScrapeNewParamsGotoOptions
- type ScrapeNewParamsGotoOptionsWaitUntilArray
- type ScrapeNewParamsGotoOptionsWaitUntilArrayItem
- type ScrapeNewParamsGotoOptionsWaitUntilString
- type ScrapeNewParamsGotoOptionsWaitUntilUnion
- type ScrapeNewParamsRejectResourceType
- type ScrapeNewParamsViewport
- type ScrapeNewParamsWaitForSelector
- type ScrapeNewParamsWaitForSelectorHidden
- type ScrapeNewParamsWaitForSelectorVisible
- type ScrapeNewResponse
- type ScrapeNewResponseEnvelope
- type ScrapeNewResponseEnvelopeErrors
- type ScrapeNewResponseResult
- type ScrapeNewResponseResultAttribute
- type ScrapeService
- type ScreenshotNewParams
- type ScreenshotNewParamsAddScriptTag
- type ScreenshotNewParamsAddStyleTag
- type ScreenshotNewParamsAllowResourceType
- type ScreenshotNewParamsAuthenticate
- type ScreenshotNewParamsCookie
- type ScreenshotNewParamsCookiesPriority
- type ScreenshotNewParamsCookiesSameSite
- type ScreenshotNewParamsCookiesSourceScheme
- type ScreenshotNewParamsGotoOptions
- type ScreenshotNewParamsGotoOptionsWaitUntilArray
- type ScreenshotNewParamsGotoOptionsWaitUntilArrayItem
- type ScreenshotNewParamsGotoOptionsWaitUntilString
- type ScreenshotNewParamsGotoOptionsWaitUntilUnion
- type ScreenshotNewParamsRejectResourceType
- type ScreenshotNewParamsScreenshotOptions
- type ScreenshotNewParamsScreenshotOptionsClip
- type ScreenshotNewParamsScreenshotOptionsEncoding
- type ScreenshotNewParamsScreenshotOptionsType
- type ScreenshotNewParamsViewport
- type ScreenshotNewParamsWaitForSelector
- type ScreenshotNewParamsWaitForSelectorHidden
- type ScreenshotNewParamsWaitForSelectorVisible
- type ScreenshotNewResponse
- type ScreenshotNewResponseError
- type ScreenshotService
- type SnapshotNewParams
- type SnapshotNewParamsAddScriptTag
- type SnapshotNewParamsAddStyleTag
- type SnapshotNewParamsAllowResourceType
- type SnapshotNewParamsAuthenticate
- type SnapshotNewParamsCookie
- type SnapshotNewParamsCookiesPriority
- type SnapshotNewParamsCookiesSameSite
- type SnapshotNewParamsCookiesSourceScheme
- type SnapshotNewParamsGotoOptions
- type SnapshotNewParamsGotoOptionsWaitUntilArray
- type SnapshotNewParamsGotoOptionsWaitUntilArrayItem
- type SnapshotNewParamsGotoOptionsWaitUntilString
- type SnapshotNewParamsGotoOptionsWaitUntilUnion
- type SnapshotNewParamsRejectResourceType
- type SnapshotNewParamsScreenshotOptions
- type SnapshotNewParamsScreenshotOptionsClip
- type SnapshotNewParamsScreenshotOptionsType
- type SnapshotNewParamsViewport
- type SnapshotNewParamsWaitForSelector
- type SnapshotNewParamsWaitForSelectorHidden
- type SnapshotNewParamsWaitForSelectorVisible
- type SnapshotNewResponse
- type SnapshotNewResponseEnvelope
- type SnapshotNewResponseEnvelopeErrors
- type SnapshotService
- type SortDirection
- type Subscription
- type SubscriptionFrequency
- type SubscriptionParam
- type SubscriptionState
- type Token
- type TokenCondition
- type TokenConditionCIDRList
- type TokenConditionCIDRListParam
- type TokenConditionParam
- type TokenConditionRequestIP
- type TokenConditionRequestIPParam
- type TokenParam
- type TokenPolicy
- type TokenPolicyEffect
- type TokenPolicyParam
- type TokenPolicyPermissionGroup
- type TokenPolicyPermissionGroupParam
- type TokenPolicyPermissionGroupsMeta
- type TokenPolicyPermissionGroupsMetaParam
- type TokenStatus
- type TokenValue
Constants ¶
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin
This is an alias to an internal value.
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare
This is an alias to an internal value.
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser
This is an alias to an internal value.
const CertificateCADigicert = shared.CertificateCADigicert
This is an alias to an internal value.
const CertificateCAGoogle = shared.CertificateCAGoogle
This is an alias to an internal value.
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt
This is an alias to an internal value.
const CertificateCASSLCom = shared.CertificateCASSLCom
This is an alias to an internal value.
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate
This is an alias to an internal value.
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC
This is an alias to an internal value.
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA
This is an alias to an internal value.
const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded
This is an alias to an internal value.
const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown
This is an alias to an internal value.
const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy
This is an alias to an internal value.
const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive
This is an alias to an internal value.
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI
This is an alias to an internal value.
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel
This is an alias to an internal value.
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE
This is an alias to an internal value.
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec
This is an alias to an internal value.
const CloudflareTunnelTunTypeMagic = shared.CloudflareTunnelTunTypeMagic
This is an alias to an internal value.
const CloudflareTunnelTunTypeWARP = shared.CloudflareTunnelTunTypeWARP
This is an alias to an internal value.
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector
This is an alias to an internal value.
const MemberPoliciesAccessAllow = shared.MemberPoliciesAccessAllow
This is an alias to an internal value.
const MemberPoliciesAccessDeny = shared.MemberPoliciesAccessDeny
This is an alias to an internal value.
const MemberStatusAccepted = shared.MemberStatusAccepted
This is an alias to an internal value.
const MemberStatusPending = shared.MemberStatusPending
This is an alias to an internal value.
const RatePlanIDBusiness = shared.RatePlanIDBusiness
This is an alias to an internal value.
const RatePlanIDEnterprise = shared.RatePlanIDEnterprise
This is an alias to an internal value.
const RatePlanIDFree = shared.RatePlanIDFree
This is an alias to an internal value.
const RatePlanIDLite = shared.RatePlanIDLite
This is an alias to an internal value.
const RatePlanIDPartnersBusiness = shared.RatePlanIDPartnersBusiness
This is an alias to an internal value.
const RatePlanIDPartnersEnterprise = shared.RatePlanIDPartnersEnterprise
This is an alias to an internal value.
const RatePlanIDPartnersFree = shared.RatePlanIDPartnersFree
This is an alias to an internal value.
const RatePlanIDPartnersPro = shared.RatePlanIDPartnersPro
This is an alias to an internal value.
const RatePlanIDPro = shared.RatePlanIDPro
This is an alias to an internal value.
const RatePlanIDProPlus = shared.RatePlanIDProPlus
This is an alias to an internal value.
const SortDirectionAsc = shared.SortDirectionAsc
This is an alias to an internal value.
const SortDirectionDesc = shared.SortDirectionDesc
This is an alias to an internal value.
const SubscriptionFrequencyMonthly = shared.SubscriptionFrequencyMonthly
This is an alias to an internal value.
const SubscriptionFrequencyQuarterly = shared.SubscriptionFrequencyQuarterly
This is an alias to an internal value.
const SubscriptionFrequencyWeekly = shared.SubscriptionFrequencyWeekly
This is an alias to an internal value.
const SubscriptionFrequencyYearly = shared.SubscriptionFrequencyYearly
This is an alias to an internal value.
const SubscriptionStateAwaitingPayment = shared.SubscriptionStateAwaitingPayment
This is an alias to an internal value.
const SubscriptionStateCancelled = shared.SubscriptionStateCancelled
This is an alias to an internal value.
const SubscriptionStateExpired = shared.SubscriptionStateExpired
This is an alias to an internal value.
const SubscriptionStateFailed = shared.SubscriptionStateFailed
This is an alias to an internal value.
const SubscriptionStatePaid = shared.SubscriptionStatePaid
This is an alias to an internal value.
const SubscriptionStateProvisioned = shared.SubscriptionStateProvisioned
This is an alias to an internal value.
const SubscriptionStateTrial = shared.SubscriptionStateTrial
This is an alias to an internal value.
const TokenPolicyEffectAllow = shared.TokenPolicyEffectAllow
This is an alias to an internal value.
const TokenPolicyEffectDeny = shared.TokenPolicyEffectDeny
This is an alias to an internal value.
const TokenStatusActive = shared.TokenStatusActive
This is an alias to an internal value.
const TokenStatusDisabled = shared.TokenStatusDisabled
This is an alias to an internal value.
const TokenStatusExpired = shared.TokenStatusExpired
This is an alias to an internal value.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditLogAction ¶
type AuditLogAction = shared.AuditLogAction
This is an alias to an internal type.
type AuditLogActor ¶
type AuditLogActor = shared.AuditLogActor
This is an alias to an internal type.
type AuditLogActorType ¶
type AuditLogActorType = shared.AuditLogActorType
The type of actor, whether a User, Cloudflare Admin, or an Automated System.
This is an alias to an internal type.
type AuditLogOwner ¶
type AuditLogOwner = shared.AuditLogOwner
This is an alias to an internal type.
type AuditLogResource ¶
type AuditLogResource = shared.AuditLogResource
This is an alias to an internal type.
type BrowserRenderingService ¶
type BrowserRenderingService struct {
Options []option.RequestOption
Content *ContentService
PDF *PDFService
Scrape *ScrapeService
Screenshot *ScreenshotService
Snapshot *SnapshotService
}
BrowserRenderingService contains methods and other services that help with interacting with the cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBrowserRenderingService method instead.
func NewBrowserRenderingService ¶
func NewBrowserRenderingService(opts ...option.RequestOption) (r *BrowserRenderingService)
NewBrowserRenderingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type CertificateCA ¶
type CertificateCA = shared.CertificateCA
The Certificate Authority that will issue the certificate
This is an alias to an internal type.
type CertificateRequestType ¶
type CertificateRequestType = shared.CertificateRequestType
Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).
This is an alias to an internal type.
type CloudflareTunnel ¶
type CloudflareTunnel = shared.CloudflareTunnel
A Cloudflare Tunnel that connects your origin to Cloudflare's edge.
This is an alias to an internal type.
type CloudflareTunnelConnection ¶
type CloudflareTunnelConnection = shared.CloudflareTunnelConnection
This is an alias to an internal type.
type CloudflareTunnelStatus ¶
type CloudflareTunnelStatus = shared.CloudflareTunnelStatus
The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).
This is an alias to an internal type.
type CloudflareTunnelTunType ¶
type CloudflareTunnelTunType = shared.CloudflareTunnelTunType
The type of tunnel.
This is an alias to an internal type.
type ContentNewParams ¶
type ContentNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id,required"`
// Cache TTL default is 5s. Set to 0 to disable.
CacheTTL param.Field[float64] `query:"cacheTTL"`
// Adds a `<script>` tag into the page with the desired URL or content.
AddScriptTag param.Field[[]ContentNewParamsAddScriptTag] `json:"addScriptTag"`
// Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a
// `<style type="text/css">` tag with the content.
AddStyleTag param.Field[[]ContentNewParamsAddStyleTag] `json:"addStyleTag"`
// Only allow requests that match the provided regex patterns, eg. '/^.\*\.(css)'.
AllowRequestPattern param.Field[[]string] `json:"allowRequestPattern"`
// Only allow requests that match the provided resource types, eg. 'image' or
// 'script'.
AllowResourceTypes param.Field[[]ContentNewParamsAllowResourceType] `json:"allowResourceTypes"`
// Provide credentials for HTTP authentication.
Authenticate param.Field[ContentNewParamsAuthenticate] `json:"authenticate"`
// Attempt to proceed when 'awaited' events fail or timeout.
BestAttempt param.Field[bool] `json:"bestAttempt"`
// Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
Cookies param.Field[[]ContentNewParamsCookie] `json:"cookies"`
EmulateMediaType param.Field[string] `json:"emulateMediaType"`
// Check [options](https://pptr.dev/api/puppeteer.gotooptions).
GotoOptions param.Field[ContentNewParamsGotoOptions] `json:"gotoOptions"`
// Set the content of the page, eg: `<h1>Hello World!!</h1>`. Either `html` or
// `url` must be set.
HTML param.Field[string] `json:"html"`
// Block undesired requests that match the provided regex patterns, eg.
// '/^.\*\.(css)'.
RejectRequestPattern param.Field[[]string] `json:"rejectRequestPattern"`
// Block undesired requests that match the provided resource types, eg. 'image' or
// 'script'.
RejectResourceTypes param.Field[[]ContentNewParamsRejectResourceType] `json:"rejectResourceTypes"`
SetExtraHTTPHeaders param.Field[map[string]string] `json:"setExtraHTTPHeaders"`
SetJavaScriptEnabled param.Field[bool] `json:"setJavaScriptEnabled"`
// URL to navigate to, eg. `https://example.com`.
URL param.Field[string] `json:"url" format:"uri"`
UserAgent param.Field[string] `json:"userAgent"`
// Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
Viewport param.Field[ContentNewParamsViewport] `json:"viewport"`
// Wait for the selector to appear in page. Check
// [options](https://pptr.dev/api/puppeteer.page.waitforselector).
WaitForSelector param.Field[ContentNewParamsWaitForSelector] `json:"waitForSelector"`
// Waits for a specified timeout before continuing.
WaitForTimeout param.Field[float64] `json:"waitForTimeout"`
}
func (ContentNewParams) MarshalJSON ¶
func (r ContentNewParams) MarshalJSON() (data []byte, err error)
func (ContentNewParams) URLQuery ¶
func (r ContentNewParams) URLQuery() (v url.Values)
URLQuery serializes ContentNewParams's query parameters as `url.Values`.
type ContentNewParamsAddScriptTag ¶
type ContentNewParamsAddScriptTag struct {
ID param.Field[string] `json:"id"`
Content param.Field[string] `json:"content"`
Type param.Field[string] `json:"type"`
URL param.Field[string] `json:"url"`
}
func (ContentNewParamsAddScriptTag) MarshalJSON ¶
func (r ContentNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type ContentNewParamsAddStyleTag ¶
type ContentNewParamsAddStyleTag struct {
Content param.Field[string] `json:"content"`
URL param.Field[string] `json:"url"`
}
func (ContentNewParamsAddStyleTag) MarshalJSON ¶
func (r ContentNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type ContentNewParamsAllowResourceType ¶
type ContentNewParamsAllowResourceType string
const ( ContentNewParamsAllowResourceTypeDocument ContentNewParamsAllowResourceType = "document" ContentNewParamsAllowResourceTypeStylesheet ContentNewParamsAllowResourceType = "stylesheet" ContentNewParamsAllowResourceTypeImage ContentNewParamsAllowResourceType = "image" ContentNewParamsAllowResourceTypeMedia ContentNewParamsAllowResourceType = "media" ContentNewParamsAllowResourceTypeFont ContentNewParamsAllowResourceType = "font" ContentNewParamsAllowResourceTypeScript ContentNewParamsAllowResourceType = "script" ContentNewParamsAllowResourceTypeTexttrack ContentNewParamsAllowResourceType = "texttrack" ContentNewParamsAllowResourceTypeXHR ContentNewParamsAllowResourceType = "xhr" ContentNewParamsAllowResourceTypeFetch ContentNewParamsAllowResourceType = "fetch" ContentNewParamsAllowResourceTypePrefetch ContentNewParamsAllowResourceType = "prefetch" ContentNewParamsAllowResourceTypeEventsource ContentNewParamsAllowResourceType = "eventsource" ContentNewParamsAllowResourceTypeWebsocket ContentNewParamsAllowResourceType = "websocket" ContentNewParamsAllowResourceTypeManifest ContentNewParamsAllowResourceType = "manifest" ContentNewParamsAllowResourceTypeSignedexchange ContentNewParamsAllowResourceType = "signedexchange" ContentNewParamsAllowResourceTypePing ContentNewParamsAllowResourceType = "ping" ContentNewParamsAllowResourceTypeCspviolationreport ContentNewParamsAllowResourceType = "cspviolationreport" ContentNewParamsAllowResourceTypePreflight ContentNewParamsAllowResourceType = "preflight" ContentNewParamsAllowResourceTypeOther ContentNewParamsAllowResourceType = "other" )
func (ContentNewParamsAllowResourceType) IsKnown ¶
func (r ContentNewParamsAllowResourceType) IsKnown() bool
type ContentNewParamsAuthenticate ¶
type ContentNewParamsAuthenticate struct {
Password param.Field[string] `json:"password,required"`
Username param.Field[string] `json:"username,required"`
}
Provide credentials for HTTP authentication.
func (ContentNewParamsAuthenticate) MarshalJSON ¶
func (r ContentNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type ContentNewParamsCookie ¶
type ContentNewParamsCookie struct {
Name param.Field[string] `json:"name,required"`
Value param.Field[string] `json:"value,required"`
Domain param.Field[string] `json:"domain"`
Expires param.Field[float64] `json:"expires"`
HTTPOnly param.Field[bool] `json:"httpOnly"`
PartitionKey param.Field[string] `json:"partitionKey"`
Path param.Field[string] `json:"path"`
Priority param.Field[ContentNewParamsCookiesPriority] `json:"priority"`
SameParty param.Field[bool] `json:"sameParty"`
SameSite param.Field[ContentNewParamsCookiesSameSite] `json:"sameSite"`
Secure param.Field[bool] `json:"secure"`
SourcePort param.Field[float64] `json:"sourcePort"`
SourceScheme param.Field[ContentNewParamsCookiesSourceScheme] `json:"sourceScheme"`
URL param.Field[string] `json:"url"`
}
func (ContentNewParamsCookie) MarshalJSON ¶
func (r ContentNewParamsCookie) MarshalJSON() (data []byte, err error)
type ContentNewParamsCookiesPriority ¶
type ContentNewParamsCookiesPriority string
const ( ContentNewParamsCookiesPriorityLow ContentNewParamsCookiesPriority = "Low" ContentNewParamsCookiesPriorityMedium ContentNewParamsCookiesPriority = "Medium" ContentNewParamsCookiesPriorityHigh ContentNewParamsCookiesPriority = "High" )
func (ContentNewParamsCookiesPriority) IsKnown ¶
func (r ContentNewParamsCookiesPriority) IsKnown() bool
type ContentNewParamsCookiesSameSite ¶
type ContentNewParamsCookiesSameSite string
const ( ContentNewParamsCookiesSameSiteStrict ContentNewParamsCookiesSameSite = "Strict" ContentNewParamsCookiesSameSiteLax ContentNewParamsCookiesSameSite = "Lax" ContentNewParamsCookiesSameSiteNone ContentNewParamsCookiesSameSite = "None" )
func (ContentNewParamsCookiesSameSite) IsKnown ¶
func (r ContentNewParamsCookiesSameSite) IsKnown() bool
type ContentNewParamsCookiesSourceScheme ¶
type ContentNewParamsCookiesSourceScheme string
const ( ContentNewParamsCookiesSourceSchemeUnset ContentNewParamsCookiesSourceScheme = "Unset" ContentNewParamsCookiesSourceSchemeNonSecure ContentNewParamsCookiesSourceScheme = "NonSecure" ContentNewParamsCookiesSourceSchemeSecure ContentNewParamsCookiesSourceScheme = "Secure" )
func (ContentNewParamsCookiesSourceScheme) IsKnown ¶
func (r ContentNewParamsCookiesSourceScheme) IsKnown() bool
type ContentNewParamsGotoOptions ¶
type ContentNewParamsGotoOptions struct {
Referer param.Field[string] `json:"referer"`
ReferrerPolicy param.Field[string] `json:"referrerPolicy"`
Timeout param.Field[float64] `json:"timeout"`
WaitUntil param.Field[ContentNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"`
}
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (ContentNewParamsGotoOptions) MarshalJSON ¶
func (r ContentNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type ContentNewParamsGotoOptionsWaitUntilArray ¶
type ContentNewParamsGotoOptionsWaitUntilArray []ContentNewParamsGotoOptionsWaitUntilArrayItem
type ContentNewParamsGotoOptionsWaitUntilArrayItem ¶
type ContentNewParamsGotoOptionsWaitUntilArrayItem string
const ( ContentNewParamsGotoOptionsWaitUntilArrayItemLoad ContentNewParamsGotoOptionsWaitUntilArrayItem = "load" ContentNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded ContentNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" ContentNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 ContentNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" ContentNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 ContentNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (ContentNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶
func (r ContentNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type ContentNewParamsGotoOptionsWaitUntilString ¶
type ContentNewParamsGotoOptionsWaitUntilString string
const ( ContentNewParamsGotoOptionsWaitUntilStringLoad ContentNewParamsGotoOptionsWaitUntilString = "load" ContentNewParamsGotoOptionsWaitUntilStringDomcontentloaded ContentNewParamsGotoOptionsWaitUntilString = "domcontentloaded" ContentNewParamsGotoOptionsWaitUntilStringNetworkidle0 ContentNewParamsGotoOptionsWaitUntilString = "networkidle0" ContentNewParamsGotoOptionsWaitUntilStringNetworkidle2 ContentNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (ContentNewParamsGotoOptionsWaitUntilString) IsKnown ¶
func (r ContentNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type ContentNewParamsGotoOptionsWaitUntilUnion ¶
type ContentNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.ContentNewParamsGotoOptionsWaitUntilString, browser_rendering.ContentNewParamsGotoOptionsWaitUntilArray.
type ContentNewParamsRejectResourceType ¶
type ContentNewParamsRejectResourceType string
const ( ContentNewParamsRejectResourceTypeDocument ContentNewParamsRejectResourceType = "document" ContentNewParamsRejectResourceTypeStylesheet ContentNewParamsRejectResourceType = "stylesheet" ContentNewParamsRejectResourceTypeImage ContentNewParamsRejectResourceType = "image" ContentNewParamsRejectResourceTypeMedia ContentNewParamsRejectResourceType = "media" ContentNewParamsRejectResourceTypeFont ContentNewParamsRejectResourceType = "font" ContentNewParamsRejectResourceTypeScript ContentNewParamsRejectResourceType = "script" ContentNewParamsRejectResourceTypeTexttrack ContentNewParamsRejectResourceType = "texttrack" ContentNewParamsRejectResourceTypeXHR ContentNewParamsRejectResourceType = "xhr" ContentNewParamsRejectResourceTypeFetch ContentNewParamsRejectResourceType = "fetch" ContentNewParamsRejectResourceTypePrefetch ContentNewParamsRejectResourceType = "prefetch" ContentNewParamsRejectResourceTypeEventsource ContentNewParamsRejectResourceType = "eventsource" ContentNewParamsRejectResourceTypeWebsocket ContentNewParamsRejectResourceType = "websocket" ContentNewParamsRejectResourceTypeManifest ContentNewParamsRejectResourceType = "manifest" ContentNewParamsRejectResourceTypeSignedexchange ContentNewParamsRejectResourceType = "signedexchange" ContentNewParamsRejectResourceTypePing ContentNewParamsRejectResourceType = "ping" ContentNewParamsRejectResourceTypeCspviolationreport ContentNewParamsRejectResourceType = "cspviolationreport" ContentNewParamsRejectResourceTypePreflight ContentNewParamsRejectResourceType = "preflight" ContentNewParamsRejectResourceTypeOther ContentNewParamsRejectResourceType = "other" )
func (ContentNewParamsRejectResourceType) IsKnown ¶
func (r ContentNewParamsRejectResourceType) IsKnown() bool
type ContentNewParamsViewport ¶
type ContentNewParamsViewport struct {
Height param.Field[float64] `json:"height,required"`
Width param.Field[float64] `json:"width,required"`
DeviceScaleFactor param.Field[float64] `json:"deviceScaleFactor"`
HasTouch param.Field[bool] `json:"hasTouch"`
IsLandscape param.Field[bool] `json:"isLandscape"`
IsMobile param.Field[bool] `json:"isMobile"`
}
Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
func (ContentNewParamsViewport) MarshalJSON ¶
func (r ContentNewParamsViewport) MarshalJSON() (data []byte, err error)
type ContentNewParamsWaitForSelector ¶
type ContentNewParamsWaitForSelector struct {
Selector param.Field[string] `json:"selector,required"`
Hidden param.Field[ContentNewParamsWaitForSelectorHidden] `json:"hidden"`
Timeout param.Field[float64] `json:"timeout"`
Visible param.Field[ContentNewParamsWaitForSelectorVisible] `json:"visible"`
}
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (ContentNewParamsWaitForSelector) MarshalJSON ¶
func (r ContentNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type ContentNewParamsWaitForSelectorHidden ¶
type ContentNewParamsWaitForSelectorHidden bool
const (
ContentNewParamsWaitForSelectorHiddenTrue ContentNewParamsWaitForSelectorHidden = true
)
func (ContentNewParamsWaitForSelectorHidden) IsKnown ¶
func (r ContentNewParamsWaitForSelectorHidden) IsKnown() bool
type ContentNewParamsWaitForSelectorVisible ¶
type ContentNewParamsWaitForSelectorVisible bool
const (
ContentNewParamsWaitForSelectorVisibleTrue ContentNewParamsWaitForSelectorVisible = true
)
func (ContentNewParamsWaitForSelectorVisible) IsKnown ¶
func (r ContentNewParamsWaitForSelectorVisible) IsKnown() bool
type ContentNewResponseEnvelope ¶
type ContentNewResponseEnvelope struct {
// Response status
Status bool `json:"status,required"`
Errors []ContentNewResponseEnvelopeErrors `json:"errors"`
// HTML content
Result string `json:"result"`
JSON contentNewResponseEnvelopeJSON `json:"-"`
}
func (*ContentNewResponseEnvelope) UnmarshalJSON ¶
func (r *ContentNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type ContentNewResponseEnvelopeErrors ¶
type ContentNewResponseEnvelopeErrors struct {
// Error code
Code float64 `json:"code,required"`
// Error Message
Message string `json:"message,required"`
JSON contentNewResponseEnvelopeErrorsJSON `json:"-"`
}
func (*ContentNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *ContentNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type ContentService ¶
type ContentService struct {
Options []option.RequestOption
}
ContentService contains methods and other services that help with interacting with the cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewContentService method instead.
func NewContentService ¶
func NewContentService(opts ...option.RequestOption) (r *ContentService)
NewContentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ContentService) New ¶
func (r *ContentService) New(ctx context.Context, params ContentNewParams, opts ...option.RequestOption) (res *string, err error)
Fetches rendered HTML content from provided URL or HTML. Check available options like `gotoOptions` and `waitFor*` to control page load behaviour.
type ErrorDataSource ¶
type ErrorDataSource = shared.ErrorDataSource
This is an alias to an internal type.
type MemberPoliciesAccess ¶
type MemberPoliciesAccess = shared.MemberPoliciesAccess
Allow or deny operations against the resources.
This is an alias to an internal type.
type MemberPoliciesPermissionGroup ¶
type MemberPoliciesPermissionGroup = shared.MemberPoliciesPermissionGroup
A named group of permissions that map to a group of operations against resources.
This is an alias to an internal type.
type MemberPoliciesPermissionGroupsMeta ¶
type MemberPoliciesPermissionGroupsMeta = shared.MemberPoliciesPermissionGroupsMeta
Attributes associated to the permission group.
This is an alias to an internal type.
type MemberPoliciesResourceGroup ¶
type MemberPoliciesResourceGroup = shared.MemberPoliciesResourceGroup
A group of scoped resources.
This is an alias to an internal type.
type MemberPoliciesResourceGroupsMeta ¶
type MemberPoliciesResourceGroupsMeta = shared.MemberPoliciesResourceGroupsMeta
Attributes associated to the resource group.
This is an alias to an internal type.
type MemberPoliciesResourceGroupsScope ¶
type MemberPoliciesResourceGroupsScope = shared.MemberPoliciesResourceGroupsScope
A scope is a combination of scope objects which provides additional context.
This is an alias to an internal type.
type MemberPoliciesResourceGroupsScopeObject ¶
type MemberPoliciesResourceGroupsScopeObject = shared.MemberPoliciesResourceGroupsScopeObject
A scope object represents any resource that can have actions applied against invite.
This is an alias to an internal type.
type MemberStatus ¶
type MemberStatus = shared.MemberStatus
A member's status in the account.
This is an alias to an internal type.
type MemberUser ¶
type MemberUser = shared.MemberUser
Details of the user associated to the membership.
This is an alias to an internal type.
type PDFNewParams ¶
type PDFNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id,required"`
// Cache TTL default is 5s. Set to 0 to disable.
CacheTTL param.Field[float64] `query:"cacheTTL"`
// Adds a `<script>` tag into the page with the desired URL or content.
AddScriptTag param.Field[[]PDFNewParamsAddScriptTag] `json:"addScriptTag"`
// Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a
// `<style type="text/css">` tag with the content.
AddStyleTag param.Field[[]PDFNewParamsAddStyleTag] `json:"addStyleTag"`
// Only allow requests that match the provided regex patterns, eg. '/^.\*\.(css)'.
AllowRequestPattern param.Field[[]string] `json:"allowRequestPattern"`
// Only allow requests that match the provided resource types, eg. 'image' or
// 'script'.
AllowResourceTypes param.Field[[]PDFNewParamsAllowResourceType] `json:"allowResourceTypes"`
// Provide credentials for HTTP authentication.
Authenticate param.Field[PDFNewParamsAuthenticate] `json:"authenticate"`
// Attempt to proceed when 'awaited' events fail or timeout.
BestAttempt param.Field[bool] `json:"bestAttempt"`
// Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
Cookies param.Field[[]PDFNewParamsCookie] `json:"cookies"`
EmulateMediaType param.Field[string] `json:"emulateMediaType"`
// Check [options](https://pptr.dev/api/puppeteer.gotooptions).
GotoOptions param.Field[PDFNewParamsGotoOptions] `json:"gotoOptions"`
// Set the content of the page, eg: `<h1>Hello World!!</h1>`. Either `html` or
// `url` must be set.
HTML param.Field[string] `json:"html"`
// Block undesired requests that match the provided regex patterns, eg.
// '/^.\*\.(css)'.
RejectRequestPattern param.Field[[]string] `json:"rejectRequestPattern"`
// Block undesired requests that match the provided resource types, eg. 'image' or
// 'script'.
RejectResourceTypes param.Field[[]PDFNewParamsRejectResourceType] `json:"rejectResourceTypes"`
SetExtraHTTPHeaders param.Field[map[string]string] `json:"setExtraHTTPHeaders"`
SetJavaScriptEnabled param.Field[bool] `json:"setJavaScriptEnabled"`
// URL to navigate to, eg. `https://example.com`.
URL param.Field[string] `json:"url" format:"uri"`
UserAgent param.Field[string] `json:"userAgent"`
// Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
Viewport param.Field[PDFNewParamsViewport] `json:"viewport"`
// Wait for the selector to appear in page. Check
// [options](https://pptr.dev/api/puppeteer.page.waitforselector).
WaitForSelector param.Field[PDFNewParamsWaitForSelector] `json:"waitForSelector"`
// Waits for a specified timeout before continuing.
WaitForTimeout param.Field[float64] `json:"waitForTimeout"`
}
func (PDFNewParams) MarshalJSON ¶
func (r PDFNewParams) MarshalJSON() (data []byte, err error)
func (PDFNewParams) URLQuery ¶
func (r PDFNewParams) URLQuery() (v url.Values)
URLQuery serializes PDFNewParams's query parameters as `url.Values`.
type PDFNewParamsAddScriptTag ¶
type PDFNewParamsAddScriptTag struct {
ID param.Field[string] `json:"id"`
Content param.Field[string] `json:"content"`
Type param.Field[string] `json:"type"`
URL param.Field[string] `json:"url"`
}
func (PDFNewParamsAddScriptTag) MarshalJSON ¶
func (r PDFNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type PDFNewParamsAddStyleTag ¶
type PDFNewParamsAddStyleTag struct {
Content param.Field[string] `json:"content"`
URL param.Field[string] `json:"url"`
}
func (PDFNewParamsAddStyleTag) MarshalJSON ¶
func (r PDFNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type PDFNewParamsAllowResourceType ¶
type PDFNewParamsAllowResourceType string
const ( PDFNewParamsAllowResourceTypeDocument PDFNewParamsAllowResourceType = "document" PDFNewParamsAllowResourceTypeStylesheet PDFNewParamsAllowResourceType = "stylesheet" PDFNewParamsAllowResourceTypeImage PDFNewParamsAllowResourceType = "image" PDFNewParamsAllowResourceTypeMedia PDFNewParamsAllowResourceType = "media" PDFNewParamsAllowResourceTypeFont PDFNewParamsAllowResourceType = "font" PDFNewParamsAllowResourceTypeScript PDFNewParamsAllowResourceType = "script" PDFNewParamsAllowResourceTypeTexttrack PDFNewParamsAllowResourceType = "texttrack" PDFNewParamsAllowResourceTypeXHR PDFNewParamsAllowResourceType = "xhr" PDFNewParamsAllowResourceTypeFetch PDFNewParamsAllowResourceType = "fetch" PDFNewParamsAllowResourceTypePrefetch PDFNewParamsAllowResourceType = "prefetch" PDFNewParamsAllowResourceTypeEventsource PDFNewParamsAllowResourceType = "eventsource" PDFNewParamsAllowResourceTypeWebsocket PDFNewParamsAllowResourceType = "websocket" PDFNewParamsAllowResourceTypeManifest PDFNewParamsAllowResourceType = "manifest" PDFNewParamsAllowResourceTypeSignedexchange PDFNewParamsAllowResourceType = "signedexchange" PDFNewParamsAllowResourceTypePing PDFNewParamsAllowResourceType = "ping" PDFNewParamsAllowResourceTypeCspviolationreport PDFNewParamsAllowResourceType = "cspviolationreport" PDFNewParamsAllowResourceTypePreflight PDFNewParamsAllowResourceType = "preflight" PDFNewParamsAllowResourceTypeOther PDFNewParamsAllowResourceType = "other" )
func (PDFNewParamsAllowResourceType) IsKnown ¶
func (r PDFNewParamsAllowResourceType) IsKnown() bool
type PDFNewParamsAuthenticate ¶
type PDFNewParamsAuthenticate struct {
Password param.Field[string] `json:"password,required"`
Username param.Field[string] `json:"username,required"`
}
Provide credentials for HTTP authentication.
func (PDFNewParamsAuthenticate) MarshalJSON ¶
func (r PDFNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type PDFNewParamsCookie ¶
type PDFNewParamsCookie struct {
Name param.Field[string] `json:"name,required"`
Value param.Field[string] `json:"value,required"`
Domain param.Field[string] `json:"domain"`
Expires param.Field[float64] `json:"expires"`
HTTPOnly param.Field[bool] `json:"httpOnly"`
PartitionKey param.Field[string] `json:"partitionKey"`
Path param.Field[string] `json:"path"`
Priority param.Field[PDFNewParamsCookiesPriority] `json:"priority"`
SameParty param.Field[bool] `json:"sameParty"`
SameSite param.Field[PDFNewParamsCookiesSameSite] `json:"sameSite"`
Secure param.Field[bool] `json:"secure"`
SourcePort param.Field[float64] `json:"sourcePort"`
SourceScheme param.Field[PDFNewParamsCookiesSourceScheme] `json:"sourceScheme"`
URL param.Field[string] `json:"url"`
}
func (PDFNewParamsCookie) MarshalJSON ¶
func (r PDFNewParamsCookie) MarshalJSON() (data []byte, err error)
type PDFNewParamsCookiesPriority ¶
type PDFNewParamsCookiesPriority string
const ( PDFNewParamsCookiesPriorityLow PDFNewParamsCookiesPriority = "Low" PDFNewParamsCookiesPriorityMedium PDFNewParamsCookiesPriority = "Medium" PDFNewParamsCookiesPriorityHigh PDFNewParamsCookiesPriority = "High" )
func (PDFNewParamsCookiesPriority) IsKnown ¶
func (r PDFNewParamsCookiesPriority) IsKnown() bool
type PDFNewParamsCookiesSameSite ¶
type PDFNewParamsCookiesSameSite string
const ( PDFNewParamsCookiesSameSiteStrict PDFNewParamsCookiesSameSite = "Strict" PDFNewParamsCookiesSameSiteLax PDFNewParamsCookiesSameSite = "Lax" PDFNewParamsCookiesSameSiteNone PDFNewParamsCookiesSameSite = "None" )
func (PDFNewParamsCookiesSameSite) IsKnown ¶
func (r PDFNewParamsCookiesSameSite) IsKnown() bool
type PDFNewParamsCookiesSourceScheme ¶
type PDFNewParamsCookiesSourceScheme string
const ( PDFNewParamsCookiesSourceSchemeUnset PDFNewParamsCookiesSourceScheme = "Unset" PDFNewParamsCookiesSourceSchemeNonSecure PDFNewParamsCookiesSourceScheme = "NonSecure" PDFNewParamsCookiesSourceSchemeSecure PDFNewParamsCookiesSourceScheme = "Secure" )
func (PDFNewParamsCookiesSourceScheme) IsKnown ¶
func (r PDFNewParamsCookiesSourceScheme) IsKnown() bool
type PDFNewParamsGotoOptions ¶
type PDFNewParamsGotoOptions struct {
Referer param.Field[string] `json:"referer"`
ReferrerPolicy param.Field[string] `json:"referrerPolicy"`
Timeout param.Field[float64] `json:"timeout"`
WaitUntil param.Field[PDFNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"`
}
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (PDFNewParamsGotoOptions) MarshalJSON ¶
func (r PDFNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type PDFNewParamsGotoOptionsWaitUntilArray ¶
type PDFNewParamsGotoOptionsWaitUntilArray []PDFNewParamsGotoOptionsWaitUntilArrayItem
type PDFNewParamsGotoOptionsWaitUntilArrayItem ¶
type PDFNewParamsGotoOptionsWaitUntilArrayItem string
const ( PDFNewParamsGotoOptionsWaitUntilArrayItemLoad PDFNewParamsGotoOptionsWaitUntilArrayItem = "load" PDFNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded PDFNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" PDFNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 PDFNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" PDFNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 PDFNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (PDFNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶
func (r PDFNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type PDFNewParamsGotoOptionsWaitUntilString ¶
type PDFNewParamsGotoOptionsWaitUntilString string
const ( PDFNewParamsGotoOptionsWaitUntilStringLoad PDFNewParamsGotoOptionsWaitUntilString = "load" PDFNewParamsGotoOptionsWaitUntilStringDomcontentloaded PDFNewParamsGotoOptionsWaitUntilString = "domcontentloaded" PDFNewParamsGotoOptionsWaitUntilStringNetworkidle0 PDFNewParamsGotoOptionsWaitUntilString = "networkidle0" PDFNewParamsGotoOptionsWaitUntilStringNetworkidle2 PDFNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (PDFNewParamsGotoOptionsWaitUntilString) IsKnown ¶
func (r PDFNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type PDFNewParamsGotoOptionsWaitUntilUnion ¶
type PDFNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.PDFNewParamsGotoOptionsWaitUntilString, browser_rendering.PDFNewParamsGotoOptionsWaitUntilArray.
type PDFNewParamsRejectResourceType ¶
type PDFNewParamsRejectResourceType string
const ( PDFNewParamsRejectResourceTypeDocument PDFNewParamsRejectResourceType = "document" PDFNewParamsRejectResourceTypeStylesheet PDFNewParamsRejectResourceType = "stylesheet" PDFNewParamsRejectResourceTypeImage PDFNewParamsRejectResourceType = "image" PDFNewParamsRejectResourceTypeMedia PDFNewParamsRejectResourceType = "media" PDFNewParamsRejectResourceTypeFont PDFNewParamsRejectResourceType = "font" PDFNewParamsRejectResourceTypeScript PDFNewParamsRejectResourceType = "script" PDFNewParamsRejectResourceTypeTexttrack PDFNewParamsRejectResourceType = "texttrack" PDFNewParamsRejectResourceTypeXHR PDFNewParamsRejectResourceType = "xhr" PDFNewParamsRejectResourceTypeFetch PDFNewParamsRejectResourceType = "fetch" PDFNewParamsRejectResourceTypePrefetch PDFNewParamsRejectResourceType = "prefetch" PDFNewParamsRejectResourceTypeEventsource PDFNewParamsRejectResourceType = "eventsource" PDFNewParamsRejectResourceTypeWebsocket PDFNewParamsRejectResourceType = "websocket" PDFNewParamsRejectResourceTypeManifest PDFNewParamsRejectResourceType = "manifest" PDFNewParamsRejectResourceTypeSignedexchange PDFNewParamsRejectResourceType = "signedexchange" PDFNewParamsRejectResourceTypePing PDFNewParamsRejectResourceType = "ping" PDFNewParamsRejectResourceTypeCspviolationreport PDFNewParamsRejectResourceType = "cspviolationreport" PDFNewParamsRejectResourceTypePreflight PDFNewParamsRejectResourceType = "preflight" PDFNewParamsRejectResourceTypeOther PDFNewParamsRejectResourceType = "other" )
func (PDFNewParamsRejectResourceType) IsKnown ¶
func (r PDFNewParamsRejectResourceType) IsKnown() bool
type PDFNewParamsViewport ¶
type PDFNewParamsViewport struct {
Height param.Field[float64] `json:"height,required"`
Width param.Field[float64] `json:"width,required"`
DeviceScaleFactor param.Field[float64] `json:"deviceScaleFactor"`
HasTouch param.Field[bool] `json:"hasTouch"`
IsLandscape param.Field[bool] `json:"isLandscape"`
IsMobile param.Field[bool] `json:"isMobile"`
}
Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
func (PDFNewParamsViewport) MarshalJSON ¶
func (r PDFNewParamsViewport) MarshalJSON() (data []byte, err error)
type PDFNewParamsWaitForSelector ¶
type PDFNewParamsWaitForSelector struct {
Selector param.Field[string] `json:"selector,required"`
Hidden param.Field[PDFNewParamsWaitForSelectorHidden] `json:"hidden"`
Timeout param.Field[float64] `json:"timeout"`
Visible param.Field[PDFNewParamsWaitForSelectorVisible] `json:"visible"`
}
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (PDFNewParamsWaitForSelector) MarshalJSON ¶
func (r PDFNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type PDFNewParamsWaitForSelectorHidden ¶
type PDFNewParamsWaitForSelectorHidden bool
const (
PDFNewParamsWaitForSelectorHiddenTrue PDFNewParamsWaitForSelectorHidden = true
)
func (PDFNewParamsWaitForSelectorHidden) IsKnown ¶
func (r PDFNewParamsWaitForSelectorHidden) IsKnown() bool
type PDFNewParamsWaitForSelectorVisible ¶
type PDFNewParamsWaitForSelectorVisible bool
const (
PDFNewParamsWaitForSelectorVisibleTrue PDFNewParamsWaitForSelectorVisible = true
)
func (PDFNewParamsWaitForSelectorVisible) IsKnown ¶
func (r PDFNewParamsWaitForSelectorVisible) IsKnown() bool
type PDFService ¶
type PDFService struct {
Options []option.RequestOption
}
PDFService contains methods and other services that help with interacting with the cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPDFService method instead.
func NewPDFService ¶
func NewPDFService(opts ...option.RequestOption) (r *PDFService)
NewPDFService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PDFService) New ¶
func (r *PDFService) New(ctx context.Context, params PDFNewParams, opts ...option.RequestOption) (res *http.Response, err error)
Fetches rendered PDF from provided URL or HTML. Check available options like `gotoOptions` and `waitFor*` to control page load behaviour.
type PermissionGrant ¶
type PermissionGrant = shared.PermissionGrant
This is an alias to an internal type.
type PermissionGrantParam ¶
type PermissionGrantParam = shared.PermissionGrantParam
This is an alias to an internal type.
type RatePlanID ¶
type RatePlanID = shared.RatePlanID
The ID of the rate plan.
This is an alias to an internal type.
type RatePlanParam ¶
type RatePlanParam = shared.RatePlanParam
The rate plan applied to the subscription.
This is an alias to an internal type.
type RolePermissions ¶
type RolePermissions = shared.RolePermissions
This is an alias to an internal type.
type RolePermissionsParam ¶
type RolePermissionsParam = shared.RolePermissionsParam
This is an alias to an internal type.
type ScrapeNewParams ¶
type ScrapeNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id,required"`
Elements param.Field[[]ScrapeNewParamsElement] `json:"elements,required"`
// Cache TTL default is 5s. Set to 0 to disable.
CacheTTL param.Field[float64] `query:"cacheTTL"`
// Adds a `<script>` tag into the page with the desired URL or content.
AddScriptTag param.Field[[]ScrapeNewParamsAddScriptTag] `json:"addScriptTag"`
// Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a
// `<style type="text/css">` tag with the content.
AddStyleTag param.Field[[]ScrapeNewParamsAddStyleTag] `json:"addStyleTag"`
// Only allow requests that match the provided regex patterns, eg. '/^.\*\.(css)'.
AllowRequestPattern param.Field[[]string] `json:"allowRequestPattern"`
// Only allow requests that match the provided resource types, eg. 'image' or
// 'script'.
AllowResourceTypes param.Field[[]ScrapeNewParamsAllowResourceType] `json:"allowResourceTypes"`
// Provide credentials for HTTP authentication.
Authenticate param.Field[ScrapeNewParamsAuthenticate] `json:"authenticate"`
// Attempt to proceed when 'awaited' events fail or timeout.
BestAttempt param.Field[bool] `json:"bestAttempt"`
// Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
Cookies param.Field[[]ScrapeNewParamsCookie] `json:"cookies"`
EmulateMediaType param.Field[string] `json:"emulateMediaType"`
// Check [options](https://pptr.dev/api/puppeteer.gotooptions).
GotoOptions param.Field[ScrapeNewParamsGotoOptions] `json:"gotoOptions"`
// Set the content of the page, eg: `<h1>Hello World!!</h1>`. Either `html` or
// `url` must be set.
HTML param.Field[string] `json:"html"`
// Block undesired requests that match the provided regex patterns, eg.
// '/^.\*\.(css)'.
RejectRequestPattern param.Field[[]string] `json:"rejectRequestPattern"`
// Block undesired requests that match the provided resource types, eg. 'image' or
// 'script'.
RejectResourceTypes param.Field[[]ScrapeNewParamsRejectResourceType] `json:"rejectResourceTypes"`
SetExtraHTTPHeaders param.Field[map[string]string] `json:"setExtraHTTPHeaders"`
SetJavaScriptEnabled param.Field[bool] `json:"setJavaScriptEnabled"`
// URL to navigate to, eg. `https://example.com`.
URL param.Field[string] `json:"url" format:"uri"`
UserAgent param.Field[string] `json:"userAgent"`
// Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
Viewport param.Field[ScrapeNewParamsViewport] `json:"viewport"`
// Wait for the selector to appear in page. Check
// [options](https://pptr.dev/api/puppeteer.page.waitforselector).
WaitForSelector param.Field[ScrapeNewParamsWaitForSelector] `json:"waitForSelector"`
// Waits for a specified timeout before continuing.
WaitForTimeout param.Field[float64] `json:"waitForTimeout"`
}
func (ScrapeNewParams) MarshalJSON ¶
func (r ScrapeNewParams) MarshalJSON() (data []byte, err error)
func (ScrapeNewParams) URLQuery ¶
func (r ScrapeNewParams) URLQuery() (v url.Values)
URLQuery serializes ScrapeNewParams's query parameters as `url.Values`.
type ScrapeNewParamsAddScriptTag ¶
type ScrapeNewParamsAddScriptTag struct {
ID param.Field[string] `json:"id"`
Content param.Field[string] `json:"content"`
Type param.Field[string] `json:"type"`
URL param.Field[string] `json:"url"`
}
func (ScrapeNewParamsAddScriptTag) MarshalJSON ¶
func (r ScrapeNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type ScrapeNewParamsAddStyleTag ¶
type ScrapeNewParamsAddStyleTag struct {
Content param.Field[string] `json:"content"`
URL param.Field[string] `json:"url"`
}
func (ScrapeNewParamsAddStyleTag) MarshalJSON ¶
func (r ScrapeNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type ScrapeNewParamsAllowResourceType ¶
type ScrapeNewParamsAllowResourceType string
const ( ScrapeNewParamsAllowResourceTypeDocument ScrapeNewParamsAllowResourceType = "document" ScrapeNewParamsAllowResourceTypeStylesheet ScrapeNewParamsAllowResourceType = "stylesheet" ScrapeNewParamsAllowResourceTypeImage ScrapeNewParamsAllowResourceType = "image" ScrapeNewParamsAllowResourceTypeMedia ScrapeNewParamsAllowResourceType = "media" ScrapeNewParamsAllowResourceTypeFont ScrapeNewParamsAllowResourceType = "font" ScrapeNewParamsAllowResourceTypeScript ScrapeNewParamsAllowResourceType = "script" ScrapeNewParamsAllowResourceTypeTexttrack ScrapeNewParamsAllowResourceType = "texttrack" ScrapeNewParamsAllowResourceTypeXHR ScrapeNewParamsAllowResourceType = "xhr" ScrapeNewParamsAllowResourceTypeFetch ScrapeNewParamsAllowResourceType = "fetch" ScrapeNewParamsAllowResourceTypePrefetch ScrapeNewParamsAllowResourceType = "prefetch" ScrapeNewParamsAllowResourceTypeEventsource ScrapeNewParamsAllowResourceType = "eventsource" ScrapeNewParamsAllowResourceTypeWebsocket ScrapeNewParamsAllowResourceType = "websocket" ScrapeNewParamsAllowResourceTypeManifest ScrapeNewParamsAllowResourceType = "manifest" ScrapeNewParamsAllowResourceTypeSignedexchange ScrapeNewParamsAllowResourceType = "signedexchange" ScrapeNewParamsAllowResourceTypePing ScrapeNewParamsAllowResourceType = "ping" ScrapeNewParamsAllowResourceTypeCspviolationreport ScrapeNewParamsAllowResourceType = "cspviolationreport" ScrapeNewParamsAllowResourceTypePreflight ScrapeNewParamsAllowResourceType = "preflight" ScrapeNewParamsAllowResourceTypeOther ScrapeNewParamsAllowResourceType = "other" )
func (ScrapeNewParamsAllowResourceType) IsKnown ¶
func (r ScrapeNewParamsAllowResourceType) IsKnown() bool
type ScrapeNewParamsAuthenticate ¶
type ScrapeNewParamsAuthenticate struct {
Password param.Field[string] `json:"password,required"`
Username param.Field[string] `json:"username,required"`
}
Provide credentials for HTTP authentication.
func (ScrapeNewParamsAuthenticate) MarshalJSON ¶
func (r ScrapeNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type ScrapeNewParamsCookie ¶
type ScrapeNewParamsCookie struct {
Name param.Field[string] `json:"name,required"`
Value param.Field[string] `json:"value,required"`
Domain param.Field[string] `json:"domain"`
Expires param.Field[float64] `json:"expires"`
HTTPOnly param.Field[bool] `json:"httpOnly"`
PartitionKey param.Field[string] `json:"partitionKey"`
Path param.Field[string] `json:"path"`
Priority param.Field[ScrapeNewParamsCookiesPriority] `json:"priority"`
SameParty param.Field[bool] `json:"sameParty"`
SameSite param.Field[ScrapeNewParamsCookiesSameSite] `json:"sameSite"`
Secure param.Field[bool] `json:"secure"`
SourcePort param.Field[float64] `json:"sourcePort"`
SourceScheme param.Field[ScrapeNewParamsCookiesSourceScheme] `json:"sourceScheme"`
URL param.Field[string] `json:"url"`
}
func (ScrapeNewParamsCookie) MarshalJSON ¶
func (r ScrapeNewParamsCookie) MarshalJSON() (data []byte, err error)
type ScrapeNewParamsCookiesPriority ¶
type ScrapeNewParamsCookiesPriority string
const ( ScrapeNewParamsCookiesPriorityLow ScrapeNewParamsCookiesPriority = "Low" ScrapeNewParamsCookiesPriorityMedium ScrapeNewParamsCookiesPriority = "Medium" ScrapeNewParamsCookiesPriorityHigh ScrapeNewParamsCookiesPriority = "High" )
func (ScrapeNewParamsCookiesPriority) IsKnown ¶
func (r ScrapeNewParamsCookiesPriority) IsKnown() bool
type ScrapeNewParamsCookiesSameSite ¶
type ScrapeNewParamsCookiesSameSite string
const ( ScrapeNewParamsCookiesSameSiteStrict ScrapeNewParamsCookiesSameSite = "Strict" ScrapeNewParamsCookiesSameSiteLax ScrapeNewParamsCookiesSameSite = "Lax" ScrapeNewParamsCookiesSameSiteNone ScrapeNewParamsCookiesSameSite = "None" )
func (ScrapeNewParamsCookiesSameSite) IsKnown ¶
func (r ScrapeNewParamsCookiesSameSite) IsKnown() bool
type ScrapeNewParamsCookiesSourceScheme ¶
type ScrapeNewParamsCookiesSourceScheme string
const ( ScrapeNewParamsCookiesSourceSchemeUnset ScrapeNewParamsCookiesSourceScheme = "Unset" ScrapeNewParamsCookiesSourceSchemeNonSecure ScrapeNewParamsCookiesSourceScheme = "NonSecure" ScrapeNewParamsCookiesSourceSchemeSecure ScrapeNewParamsCookiesSourceScheme = "Secure" )
func (ScrapeNewParamsCookiesSourceScheme) IsKnown ¶
func (r ScrapeNewParamsCookiesSourceScheme) IsKnown() bool
type ScrapeNewParamsElement ¶
func (ScrapeNewParamsElement) MarshalJSON ¶
func (r ScrapeNewParamsElement) MarshalJSON() (data []byte, err error)
type ScrapeNewParamsGotoOptions ¶
type ScrapeNewParamsGotoOptions struct {
Referer param.Field[string] `json:"referer"`
ReferrerPolicy param.Field[string] `json:"referrerPolicy"`
Timeout param.Field[float64] `json:"timeout"`
WaitUntil param.Field[ScrapeNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"`
}
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (ScrapeNewParamsGotoOptions) MarshalJSON ¶
func (r ScrapeNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type ScrapeNewParamsGotoOptionsWaitUntilArray ¶
type ScrapeNewParamsGotoOptionsWaitUntilArray []ScrapeNewParamsGotoOptionsWaitUntilArrayItem
type ScrapeNewParamsGotoOptionsWaitUntilArrayItem ¶
type ScrapeNewParamsGotoOptionsWaitUntilArrayItem string
const ( ScrapeNewParamsGotoOptionsWaitUntilArrayItemLoad ScrapeNewParamsGotoOptionsWaitUntilArrayItem = "load" ScrapeNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded ScrapeNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" ScrapeNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 ScrapeNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" ScrapeNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 ScrapeNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (ScrapeNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶
func (r ScrapeNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type ScrapeNewParamsGotoOptionsWaitUntilString ¶
type ScrapeNewParamsGotoOptionsWaitUntilString string
const ( ScrapeNewParamsGotoOptionsWaitUntilStringLoad ScrapeNewParamsGotoOptionsWaitUntilString = "load" ScrapeNewParamsGotoOptionsWaitUntilStringDomcontentloaded ScrapeNewParamsGotoOptionsWaitUntilString = "domcontentloaded" ScrapeNewParamsGotoOptionsWaitUntilStringNetworkidle0 ScrapeNewParamsGotoOptionsWaitUntilString = "networkidle0" ScrapeNewParamsGotoOptionsWaitUntilStringNetworkidle2 ScrapeNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (ScrapeNewParamsGotoOptionsWaitUntilString) IsKnown ¶
func (r ScrapeNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type ScrapeNewParamsGotoOptionsWaitUntilUnion ¶
type ScrapeNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.ScrapeNewParamsGotoOptionsWaitUntilString, browser_rendering.ScrapeNewParamsGotoOptionsWaitUntilArray.
type ScrapeNewParamsRejectResourceType ¶
type ScrapeNewParamsRejectResourceType string
const ( ScrapeNewParamsRejectResourceTypeDocument ScrapeNewParamsRejectResourceType = "document" ScrapeNewParamsRejectResourceTypeStylesheet ScrapeNewParamsRejectResourceType = "stylesheet" ScrapeNewParamsRejectResourceTypeImage ScrapeNewParamsRejectResourceType = "image" ScrapeNewParamsRejectResourceTypeMedia ScrapeNewParamsRejectResourceType = "media" ScrapeNewParamsRejectResourceTypeFont ScrapeNewParamsRejectResourceType = "font" ScrapeNewParamsRejectResourceTypeScript ScrapeNewParamsRejectResourceType = "script" ScrapeNewParamsRejectResourceTypeTexttrack ScrapeNewParamsRejectResourceType = "texttrack" ScrapeNewParamsRejectResourceTypeXHR ScrapeNewParamsRejectResourceType = "xhr" ScrapeNewParamsRejectResourceTypeFetch ScrapeNewParamsRejectResourceType = "fetch" ScrapeNewParamsRejectResourceTypePrefetch ScrapeNewParamsRejectResourceType = "prefetch" ScrapeNewParamsRejectResourceTypeEventsource ScrapeNewParamsRejectResourceType = "eventsource" ScrapeNewParamsRejectResourceTypeWebsocket ScrapeNewParamsRejectResourceType = "websocket" ScrapeNewParamsRejectResourceTypeManifest ScrapeNewParamsRejectResourceType = "manifest" ScrapeNewParamsRejectResourceTypeSignedexchange ScrapeNewParamsRejectResourceType = "signedexchange" ScrapeNewParamsRejectResourceTypePing ScrapeNewParamsRejectResourceType = "ping" ScrapeNewParamsRejectResourceTypeCspviolationreport ScrapeNewParamsRejectResourceType = "cspviolationreport" ScrapeNewParamsRejectResourceTypePreflight ScrapeNewParamsRejectResourceType = "preflight" ScrapeNewParamsRejectResourceTypeOther ScrapeNewParamsRejectResourceType = "other" )
func (ScrapeNewParamsRejectResourceType) IsKnown ¶
func (r ScrapeNewParamsRejectResourceType) IsKnown() bool
type ScrapeNewParamsViewport ¶
type ScrapeNewParamsViewport struct {
Height param.Field[float64] `json:"height,required"`
Width param.Field[float64] `json:"width,required"`
DeviceScaleFactor param.Field[float64] `json:"deviceScaleFactor"`
HasTouch param.Field[bool] `json:"hasTouch"`
IsLandscape param.Field[bool] `json:"isLandscape"`
IsMobile param.Field[bool] `json:"isMobile"`
}
Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
func (ScrapeNewParamsViewport) MarshalJSON ¶
func (r ScrapeNewParamsViewport) MarshalJSON() (data []byte, err error)
type ScrapeNewParamsWaitForSelector ¶
type ScrapeNewParamsWaitForSelector struct {
Selector param.Field[string] `json:"selector,required"`
Hidden param.Field[ScrapeNewParamsWaitForSelectorHidden] `json:"hidden"`
Timeout param.Field[float64] `json:"timeout"`
Visible param.Field[ScrapeNewParamsWaitForSelectorVisible] `json:"visible"`
}
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (ScrapeNewParamsWaitForSelector) MarshalJSON ¶
func (r ScrapeNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type ScrapeNewParamsWaitForSelectorHidden ¶
type ScrapeNewParamsWaitForSelectorHidden bool
const (
ScrapeNewParamsWaitForSelectorHiddenTrue ScrapeNewParamsWaitForSelectorHidden = true
)
func (ScrapeNewParamsWaitForSelectorHidden) IsKnown ¶
func (r ScrapeNewParamsWaitForSelectorHidden) IsKnown() bool
type ScrapeNewParamsWaitForSelectorVisible ¶
type ScrapeNewParamsWaitForSelectorVisible bool
const (
ScrapeNewParamsWaitForSelectorVisibleTrue ScrapeNewParamsWaitForSelectorVisible = true
)
func (ScrapeNewParamsWaitForSelectorVisible) IsKnown ¶
func (r ScrapeNewParamsWaitForSelectorVisible) IsKnown() bool
type ScrapeNewResponse ¶
type ScrapeNewResponse struct {
Result ScrapeNewResponseResult `json:"result,required"`
// Selector
Selector string `json:"selector,required"`
JSON scrapeNewResponseJSON `json:"-"`
}
func (*ScrapeNewResponse) UnmarshalJSON ¶
func (r *ScrapeNewResponse) UnmarshalJSON(data []byte) (err error)
type ScrapeNewResponseEnvelope ¶
type ScrapeNewResponseEnvelope struct {
Result []ScrapeNewResponse `json:"result,required"`
// Response status
Status bool `json:"status,required"`
Errors []ScrapeNewResponseEnvelopeErrors `json:"errors"`
JSON scrapeNewResponseEnvelopeJSON `json:"-"`
}
func (*ScrapeNewResponseEnvelope) UnmarshalJSON ¶
func (r *ScrapeNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type ScrapeNewResponseEnvelopeErrors ¶
type ScrapeNewResponseEnvelopeErrors struct {
// Error code
Code float64 `json:"code,required"`
// Error Message
Message string `json:"message,required"`
JSON scrapeNewResponseEnvelopeErrorsJSON `json:"-"`
}
func (*ScrapeNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *ScrapeNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type ScrapeNewResponseResult ¶
type ScrapeNewResponseResult struct {
Attributes []ScrapeNewResponseResultAttribute `json:"attributes,required"`
// Element height
Height float64 `json:"height,required"`
// Html content
HTML string `json:"html,required"`
// Element left
Left float64 `json:"left,required"`
// Text content
Text string `json:"text,required"`
// Element top
Top float64 `json:"top,required"`
// Element width
Width float64 `json:"width,required"`
JSON scrapeNewResponseResultJSON `json:"-"`
}
func (*ScrapeNewResponseResult) UnmarshalJSON ¶
func (r *ScrapeNewResponseResult) UnmarshalJSON(data []byte) (err error)
type ScrapeNewResponseResultAttribute ¶
type ScrapeNewResponseResultAttribute struct {
// Attribute name
Name string `json:"name,required"`
// Attribute value
Value string `json:"value,required"`
JSON scrapeNewResponseResultAttributeJSON `json:"-"`
}
func (*ScrapeNewResponseResultAttribute) UnmarshalJSON ¶
func (r *ScrapeNewResponseResultAttribute) UnmarshalJSON(data []byte) (err error)
type ScrapeService ¶
type ScrapeService struct {
Options []option.RequestOption
}
ScrapeService contains methods and other services that help with interacting with the cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewScrapeService method instead.
func NewScrapeService ¶
func NewScrapeService(opts ...option.RequestOption) (r *ScrapeService)
NewScrapeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ScrapeService) New ¶
func (r *ScrapeService) New(ctx context.Context, params ScrapeNewParams, opts ...option.RequestOption) (res *[]ScrapeNewResponse, err error)
Get meta attributes like height, width, text and others of selected elements.
type ScreenshotNewParams ¶
type ScreenshotNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id,required"`
// Cache TTL default is 5s. Set to 0 to disable.
CacheTTL param.Field[float64] `query:"cacheTTL"`
// Adds a `<script>` tag into the page with the desired URL or content.
AddScriptTag param.Field[[]ScreenshotNewParamsAddScriptTag] `json:"addScriptTag"`
// Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a
// `<style type="text/css">` tag with the content.
AddStyleTag param.Field[[]ScreenshotNewParamsAddStyleTag] `json:"addStyleTag"`
// Only allow requests that match the provided regex patterns, eg. '/^.\*\.(css)'.
AllowRequestPattern param.Field[[]string] `json:"allowRequestPattern"`
// Only allow requests that match the provided resource types, eg. 'image' or
// 'script'.
AllowResourceTypes param.Field[[]ScreenshotNewParamsAllowResourceType] `json:"allowResourceTypes"`
// Provide credentials for HTTP authentication.
Authenticate param.Field[ScreenshotNewParamsAuthenticate] `json:"authenticate"`
// Attempt to proceed when 'awaited' events fail or timeout.
BestAttempt param.Field[bool] `json:"bestAttempt"`
// Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
Cookies param.Field[[]ScreenshotNewParamsCookie] `json:"cookies"`
EmulateMediaType param.Field[string] `json:"emulateMediaType"`
// Check [options](https://pptr.dev/api/puppeteer.gotooptions).
GotoOptions param.Field[ScreenshotNewParamsGotoOptions] `json:"gotoOptions"`
// Set the content of the page, eg: `<h1>Hello World!!</h1>`. Either `html` or
// `url` must be set.
HTML param.Field[string] `json:"html"`
// Block undesired requests that match the provided regex patterns, eg.
// '/^.\*\.(css)'.
RejectRequestPattern param.Field[[]string] `json:"rejectRequestPattern"`
// Block undesired requests that match the provided resource types, eg. 'image' or
// 'script'.
RejectResourceTypes param.Field[[]ScreenshotNewParamsRejectResourceType] `json:"rejectResourceTypes"`
// Check [options](https://pptr.dev/api/puppeteer.screenshotoptions).
ScreenshotOptions param.Field[ScreenshotNewParamsScreenshotOptions] `json:"screenshotOptions"`
ScrollPage param.Field[bool] `json:"scrollPage"`
Selector param.Field[string] `json:"selector"`
SetExtraHTTPHeaders param.Field[map[string]string] `json:"setExtraHTTPHeaders"`
SetJavaScriptEnabled param.Field[bool] `json:"setJavaScriptEnabled"`
// URL to navigate to, eg. `https://example.com`.
URL param.Field[string] `json:"url" format:"uri"`
UserAgent param.Field[string] `json:"userAgent"`
// Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
Viewport param.Field[ScreenshotNewParamsViewport] `json:"viewport"`
// Wait for the selector to appear in page. Check
// [options](https://pptr.dev/api/puppeteer.page.waitforselector).
WaitForSelector param.Field[ScreenshotNewParamsWaitForSelector] `json:"waitForSelector"`
// Waits for a specified timeout before continuing.
WaitForTimeout param.Field[float64] `json:"waitForTimeout"`
}
func (ScreenshotNewParams) MarshalJSON ¶
func (r ScreenshotNewParams) MarshalJSON() (data []byte, err error)
func (ScreenshotNewParams) URLQuery ¶
func (r ScreenshotNewParams) URLQuery() (v url.Values)
URLQuery serializes ScreenshotNewParams's query parameters as `url.Values`.
type ScreenshotNewParamsAddScriptTag ¶
type ScreenshotNewParamsAddScriptTag struct {
ID param.Field[string] `json:"id"`
Content param.Field[string] `json:"content"`
Type param.Field[string] `json:"type"`
URL param.Field[string] `json:"url"`
}
func (ScreenshotNewParamsAddScriptTag) MarshalJSON ¶
func (r ScreenshotNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsAddStyleTag ¶
type ScreenshotNewParamsAddStyleTag struct {
Content param.Field[string] `json:"content"`
URL param.Field[string] `json:"url"`
}
func (ScreenshotNewParamsAddStyleTag) MarshalJSON ¶
func (r ScreenshotNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsAllowResourceType ¶
type ScreenshotNewParamsAllowResourceType string
const ( ScreenshotNewParamsAllowResourceTypeDocument ScreenshotNewParamsAllowResourceType = "document" ScreenshotNewParamsAllowResourceTypeStylesheet ScreenshotNewParamsAllowResourceType = "stylesheet" ScreenshotNewParamsAllowResourceTypeImage ScreenshotNewParamsAllowResourceType = "image" ScreenshotNewParamsAllowResourceTypeMedia ScreenshotNewParamsAllowResourceType = "media" ScreenshotNewParamsAllowResourceTypeFont ScreenshotNewParamsAllowResourceType = "font" ScreenshotNewParamsAllowResourceTypeScript ScreenshotNewParamsAllowResourceType = "script" ScreenshotNewParamsAllowResourceTypeTexttrack ScreenshotNewParamsAllowResourceType = "texttrack" ScreenshotNewParamsAllowResourceTypeXHR ScreenshotNewParamsAllowResourceType = "xhr" ScreenshotNewParamsAllowResourceTypeFetch ScreenshotNewParamsAllowResourceType = "fetch" ScreenshotNewParamsAllowResourceTypePrefetch ScreenshotNewParamsAllowResourceType = "prefetch" ScreenshotNewParamsAllowResourceTypeEventsource ScreenshotNewParamsAllowResourceType = "eventsource" ScreenshotNewParamsAllowResourceTypeWebsocket ScreenshotNewParamsAllowResourceType = "websocket" ScreenshotNewParamsAllowResourceTypeManifest ScreenshotNewParamsAllowResourceType = "manifest" ScreenshotNewParamsAllowResourceTypeSignedexchange ScreenshotNewParamsAllowResourceType = "signedexchange" ScreenshotNewParamsAllowResourceTypePing ScreenshotNewParamsAllowResourceType = "ping" ScreenshotNewParamsAllowResourceTypeCspviolationreport ScreenshotNewParamsAllowResourceType = "cspviolationreport" ScreenshotNewParamsAllowResourceTypePreflight ScreenshotNewParamsAllowResourceType = "preflight" ScreenshotNewParamsAllowResourceTypeOther ScreenshotNewParamsAllowResourceType = "other" )
func (ScreenshotNewParamsAllowResourceType) IsKnown ¶
func (r ScreenshotNewParamsAllowResourceType) IsKnown() bool
type ScreenshotNewParamsAuthenticate ¶
type ScreenshotNewParamsAuthenticate struct {
Password param.Field[string] `json:"password,required"`
Username param.Field[string] `json:"username,required"`
}
Provide credentials for HTTP authentication.
func (ScreenshotNewParamsAuthenticate) MarshalJSON ¶
func (r ScreenshotNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsCookie ¶
type ScreenshotNewParamsCookie struct {
Name param.Field[string] `json:"name,required"`
Value param.Field[string] `json:"value,required"`
Domain param.Field[string] `json:"domain"`
Expires param.Field[float64] `json:"expires"`
HTTPOnly param.Field[bool] `json:"httpOnly"`
PartitionKey param.Field[string] `json:"partitionKey"`
Path param.Field[string] `json:"path"`
Priority param.Field[ScreenshotNewParamsCookiesPriority] `json:"priority"`
SameParty param.Field[bool] `json:"sameParty"`
SameSite param.Field[ScreenshotNewParamsCookiesSameSite] `json:"sameSite"`
Secure param.Field[bool] `json:"secure"`
SourcePort param.Field[float64] `json:"sourcePort"`
SourceScheme param.Field[ScreenshotNewParamsCookiesSourceScheme] `json:"sourceScheme"`
URL param.Field[string] `json:"url"`
}
func (ScreenshotNewParamsCookie) MarshalJSON ¶
func (r ScreenshotNewParamsCookie) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsCookiesPriority ¶
type ScreenshotNewParamsCookiesPriority string
const ( ScreenshotNewParamsCookiesPriorityLow ScreenshotNewParamsCookiesPriority = "Low" ScreenshotNewParamsCookiesPriorityMedium ScreenshotNewParamsCookiesPriority = "Medium" ScreenshotNewParamsCookiesPriorityHigh ScreenshotNewParamsCookiesPriority = "High" )
func (ScreenshotNewParamsCookiesPriority) IsKnown ¶
func (r ScreenshotNewParamsCookiesPriority) IsKnown() bool
type ScreenshotNewParamsCookiesSameSite ¶
type ScreenshotNewParamsCookiesSameSite string
const ( ScreenshotNewParamsCookiesSameSiteStrict ScreenshotNewParamsCookiesSameSite = "Strict" ScreenshotNewParamsCookiesSameSiteLax ScreenshotNewParamsCookiesSameSite = "Lax" ScreenshotNewParamsCookiesSameSiteNone ScreenshotNewParamsCookiesSameSite = "None" )
func (ScreenshotNewParamsCookiesSameSite) IsKnown ¶
func (r ScreenshotNewParamsCookiesSameSite) IsKnown() bool
type ScreenshotNewParamsCookiesSourceScheme ¶
type ScreenshotNewParamsCookiesSourceScheme string
const ( ScreenshotNewParamsCookiesSourceSchemeUnset ScreenshotNewParamsCookiesSourceScheme = "Unset" ScreenshotNewParamsCookiesSourceSchemeNonSecure ScreenshotNewParamsCookiesSourceScheme = "NonSecure" ScreenshotNewParamsCookiesSourceSchemeSecure ScreenshotNewParamsCookiesSourceScheme = "Secure" )
func (ScreenshotNewParamsCookiesSourceScheme) IsKnown ¶
func (r ScreenshotNewParamsCookiesSourceScheme) IsKnown() bool
type ScreenshotNewParamsGotoOptions ¶
type ScreenshotNewParamsGotoOptions struct {
Referer param.Field[string] `json:"referer"`
ReferrerPolicy param.Field[string] `json:"referrerPolicy"`
Timeout param.Field[float64] `json:"timeout"`
WaitUntil param.Field[ScreenshotNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"`
}
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (ScreenshotNewParamsGotoOptions) MarshalJSON ¶
func (r ScreenshotNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsGotoOptionsWaitUntilArray ¶
type ScreenshotNewParamsGotoOptionsWaitUntilArray []ScreenshotNewParamsGotoOptionsWaitUntilArrayItem
type ScreenshotNewParamsGotoOptionsWaitUntilArrayItem ¶
type ScreenshotNewParamsGotoOptionsWaitUntilArrayItem string
const ( ScreenshotNewParamsGotoOptionsWaitUntilArrayItemLoad ScreenshotNewParamsGotoOptionsWaitUntilArrayItem = "load" ScreenshotNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded ScreenshotNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" ScreenshotNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 ScreenshotNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" ScreenshotNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 ScreenshotNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (ScreenshotNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶
func (r ScreenshotNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type ScreenshotNewParamsGotoOptionsWaitUntilString ¶
type ScreenshotNewParamsGotoOptionsWaitUntilString string
const ( ScreenshotNewParamsGotoOptionsWaitUntilStringLoad ScreenshotNewParamsGotoOptionsWaitUntilString = "load" ScreenshotNewParamsGotoOptionsWaitUntilStringDomcontentloaded ScreenshotNewParamsGotoOptionsWaitUntilString = "domcontentloaded" ScreenshotNewParamsGotoOptionsWaitUntilStringNetworkidle0 ScreenshotNewParamsGotoOptionsWaitUntilString = "networkidle0" ScreenshotNewParamsGotoOptionsWaitUntilStringNetworkidle2 ScreenshotNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (ScreenshotNewParamsGotoOptionsWaitUntilString) IsKnown ¶
func (r ScreenshotNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type ScreenshotNewParamsGotoOptionsWaitUntilUnion ¶
type ScreenshotNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.ScreenshotNewParamsGotoOptionsWaitUntilString, browser_rendering.ScreenshotNewParamsGotoOptionsWaitUntilArray.
type ScreenshotNewParamsRejectResourceType ¶
type ScreenshotNewParamsRejectResourceType string
const ( ScreenshotNewParamsRejectResourceTypeDocument ScreenshotNewParamsRejectResourceType = "document" ScreenshotNewParamsRejectResourceTypeStylesheet ScreenshotNewParamsRejectResourceType = "stylesheet" ScreenshotNewParamsRejectResourceTypeImage ScreenshotNewParamsRejectResourceType = "image" ScreenshotNewParamsRejectResourceTypeMedia ScreenshotNewParamsRejectResourceType = "media" ScreenshotNewParamsRejectResourceTypeFont ScreenshotNewParamsRejectResourceType = "font" ScreenshotNewParamsRejectResourceTypeScript ScreenshotNewParamsRejectResourceType = "script" ScreenshotNewParamsRejectResourceTypeTexttrack ScreenshotNewParamsRejectResourceType = "texttrack" ScreenshotNewParamsRejectResourceTypeXHR ScreenshotNewParamsRejectResourceType = "xhr" ScreenshotNewParamsRejectResourceTypeFetch ScreenshotNewParamsRejectResourceType = "fetch" ScreenshotNewParamsRejectResourceTypePrefetch ScreenshotNewParamsRejectResourceType = "prefetch" ScreenshotNewParamsRejectResourceTypeEventsource ScreenshotNewParamsRejectResourceType = "eventsource" ScreenshotNewParamsRejectResourceTypeWebsocket ScreenshotNewParamsRejectResourceType = "websocket" ScreenshotNewParamsRejectResourceTypeManifest ScreenshotNewParamsRejectResourceType = "manifest" ScreenshotNewParamsRejectResourceTypeSignedexchange ScreenshotNewParamsRejectResourceType = "signedexchange" ScreenshotNewParamsRejectResourceTypePing ScreenshotNewParamsRejectResourceType = "ping" ScreenshotNewParamsRejectResourceTypeCspviolationreport ScreenshotNewParamsRejectResourceType = "cspviolationreport" ScreenshotNewParamsRejectResourceTypePreflight ScreenshotNewParamsRejectResourceType = "preflight" ScreenshotNewParamsRejectResourceTypeOther ScreenshotNewParamsRejectResourceType = "other" )
func (ScreenshotNewParamsRejectResourceType) IsKnown ¶
func (r ScreenshotNewParamsRejectResourceType) IsKnown() bool
type ScreenshotNewParamsScreenshotOptions ¶
type ScreenshotNewParamsScreenshotOptions struct {
CaptureBeyondViewport param.Field[bool] `json:"captureBeyondViewport"`
Clip param.Field[ScreenshotNewParamsScreenshotOptionsClip] `json:"clip"`
Encoding param.Field[ScreenshotNewParamsScreenshotOptionsEncoding] `json:"encoding"`
FromSurface param.Field[bool] `json:"fromSurface"`
FullPage param.Field[bool] `json:"fullPage"`
OmitBackground param.Field[bool] `json:"omitBackground"`
OptimizeForSpeed param.Field[bool] `json:"optimizeForSpeed"`
Quality param.Field[float64] `json:"quality"`
Type param.Field[ScreenshotNewParamsScreenshotOptionsType] `json:"type"`
}
Check [options](https://pptr.dev/api/puppeteer.screenshotoptions).
func (ScreenshotNewParamsScreenshotOptions) MarshalJSON ¶
func (r ScreenshotNewParamsScreenshotOptions) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsScreenshotOptionsClip ¶
type ScreenshotNewParamsScreenshotOptionsClip struct {
Height param.Field[float64] `json:"height,required"`
Width param.Field[float64] `json:"width,required"`
X param.Field[float64] `json:"x,required"`
Y param.Field[float64] `json:"y,required"`
Scale param.Field[float64] `json:"scale"`
}
func (ScreenshotNewParamsScreenshotOptionsClip) MarshalJSON ¶
func (r ScreenshotNewParamsScreenshotOptionsClip) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsScreenshotOptionsEncoding ¶
type ScreenshotNewParamsScreenshotOptionsEncoding string
const ( ScreenshotNewParamsScreenshotOptionsEncodingBinary ScreenshotNewParamsScreenshotOptionsEncoding = "binary" ScreenshotNewParamsScreenshotOptionsEncodingBase64 ScreenshotNewParamsScreenshotOptionsEncoding = "base64" )
func (ScreenshotNewParamsScreenshotOptionsEncoding) IsKnown ¶
func (r ScreenshotNewParamsScreenshotOptionsEncoding) IsKnown() bool
type ScreenshotNewParamsScreenshotOptionsType ¶
type ScreenshotNewParamsScreenshotOptionsType string
const ( ScreenshotNewParamsScreenshotOptionsTypePNG ScreenshotNewParamsScreenshotOptionsType = "png" ScreenshotNewParamsScreenshotOptionsTypeJPEG ScreenshotNewParamsScreenshotOptionsType = "jpeg" ScreenshotNewParamsScreenshotOptionsTypeWebP ScreenshotNewParamsScreenshotOptionsType = "webp" )
func (ScreenshotNewParamsScreenshotOptionsType) IsKnown ¶
func (r ScreenshotNewParamsScreenshotOptionsType) IsKnown() bool
type ScreenshotNewParamsViewport ¶
type ScreenshotNewParamsViewport struct {
Height param.Field[float64] `json:"height,required"`
Width param.Field[float64] `json:"width,required"`
DeviceScaleFactor param.Field[float64] `json:"deviceScaleFactor"`
HasTouch param.Field[bool] `json:"hasTouch"`
IsLandscape param.Field[bool] `json:"isLandscape"`
IsMobile param.Field[bool] `json:"isMobile"`
}
Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
func (ScreenshotNewParamsViewport) MarshalJSON ¶
func (r ScreenshotNewParamsViewport) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsWaitForSelector ¶
type ScreenshotNewParamsWaitForSelector struct {
Selector param.Field[string] `json:"selector,required"`
Hidden param.Field[ScreenshotNewParamsWaitForSelectorHidden] `json:"hidden"`
Timeout param.Field[float64] `json:"timeout"`
Visible param.Field[ScreenshotNewParamsWaitForSelectorVisible] `json:"visible"`
}
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (ScreenshotNewParamsWaitForSelector) MarshalJSON ¶
func (r ScreenshotNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsWaitForSelectorHidden ¶
type ScreenshotNewParamsWaitForSelectorHidden bool
const (
ScreenshotNewParamsWaitForSelectorHiddenTrue ScreenshotNewParamsWaitForSelectorHidden = true
)
func (ScreenshotNewParamsWaitForSelectorHidden) IsKnown ¶
func (r ScreenshotNewParamsWaitForSelectorHidden) IsKnown() bool
type ScreenshotNewParamsWaitForSelectorVisible ¶
type ScreenshotNewParamsWaitForSelectorVisible bool
const (
ScreenshotNewParamsWaitForSelectorVisibleTrue ScreenshotNewParamsWaitForSelectorVisible = true
)
func (ScreenshotNewParamsWaitForSelectorVisible) IsKnown ¶
func (r ScreenshotNewParamsWaitForSelectorVisible) IsKnown() bool
type ScreenshotNewResponse ¶
type ScreenshotNewResponse struct {
// Response status
Status bool `json:"status,required"`
Errors []ScreenshotNewResponseError `json:"errors"`
JSON screenshotNewResponseJSON `json:"-"`
}
func (*ScreenshotNewResponse) UnmarshalJSON ¶
func (r *ScreenshotNewResponse) UnmarshalJSON(data []byte) (err error)
type ScreenshotNewResponseError ¶
type ScreenshotNewResponseError struct {
// Error code
Code float64 `json:"code,required"`
// Error Message
Message string `json:"message,required"`
JSON screenshotNewResponseErrorJSON `json:"-"`
}
func (*ScreenshotNewResponseError) UnmarshalJSON ¶
func (r *ScreenshotNewResponseError) UnmarshalJSON(data []byte) (err error)
type ScreenshotService ¶
type ScreenshotService struct {
Options []option.RequestOption
}
ScreenshotService contains methods and other services that help with interacting with the cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewScreenshotService method instead.
func NewScreenshotService ¶
func NewScreenshotService(opts ...option.RequestOption) (r *ScreenshotService)
NewScreenshotService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ScreenshotService) New ¶
func (r *ScreenshotService) New(ctx context.Context, params ScreenshotNewParams, opts ...option.RequestOption) (res *ScreenshotNewResponse, err error)
Takes a screenshot of a webpage from provided URL or HTML. Control page loading with `gotoOptions` and `waitFor*` options. Customize screenshots with `viewport`, `fullPage`, `clip` and others.
type SnapshotNewParams ¶
type SnapshotNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id,required"`
// Cache TTL default is 5s. Set to 0 to disable.
CacheTTL param.Field[float64] `query:"cacheTTL"`
// Adds a `<script>` tag into the page with the desired URL or content.
AddScriptTag param.Field[[]SnapshotNewParamsAddScriptTag] `json:"addScriptTag"`
// Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a
// `<style type="text/css">` tag with the content.
AddStyleTag param.Field[[]SnapshotNewParamsAddStyleTag] `json:"addStyleTag"`
// Only allow requests that match the provided regex patterns, eg. '/^.\*\.(css)'.
AllowRequestPattern param.Field[[]string] `json:"allowRequestPattern"`
// Only allow requests that match the provided resource types, eg. 'image' or
// 'script'.
AllowResourceTypes param.Field[[]SnapshotNewParamsAllowResourceType] `json:"allowResourceTypes"`
// Provide credentials for HTTP authentication.
Authenticate param.Field[SnapshotNewParamsAuthenticate] `json:"authenticate"`
// Attempt to proceed when 'awaited' events fail or timeout.
BestAttempt param.Field[bool] `json:"bestAttempt"`
// Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
Cookies param.Field[[]SnapshotNewParamsCookie] `json:"cookies"`
EmulateMediaType param.Field[string] `json:"emulateMediaType"`
// Check [options](https://pptr.dev/api/puppeteer.gotooptions).
GotoOptions param.Field[SnapshotNewParamsGotoOptions] `json:"gotoOptions"`
// Set the content of the page, eg: `<h1>Hello World!!</h1>`. Either `html` or
// `url` must be set.
HTML param.Field[string] `json:"html"`
// Block undesired requests that match the provided regex patterns, eg.
// '/^.\*\.(css)'.
RejectRequestPattern param.Field[[]string] `json:"rejectRequestPattern"`
// Block undesired requests that match the provided resource types, eg. 'image' or
// 'script'.
RejectResourceTypes param.Field[[]SnapshotNewParamsRejectResourceType] `json:"rejectResourceTypes"`
ScreenshotOptions param.Field[SnapshotNewParamsScreenshotOptions] `json:"screenshotOptions"`
SetExtraHTTPHeaders param.Field[map[string]string] `json:"setExtraHTTPHeaders"`
SetJavaScriptEnabled param.Field[bool] `json:"setJavaScriptEnabled"`
// URL to navigate to, eg. `https://example.com`.
URL param.Field[string] `json:"url" format:"uri"`
UserAgent param.Field[string] `json:"userAgent"`
// Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
Viewport param.Field[SnapshotNewParamsViewport] `json:"viewport"`
// Wait for the selector to appear in page. Check
// [options](https://pptr.dev/api/puppeteer.page.waitforselector).
WaitForSelector param.Field[SnapshotNewParamsWaitForSelector] `json:"waitForSelector"`
// Waits for a specified timeout before continuing.
WaitForTimeout param.Field[float64] `json:"waitForTimeout"`
}
func (SnapshotNewParams) MarshalJSON ¶
func (r SnapshotNewParams) MarshalJSON() (data []byte, err error)
func (SnapshotNewParams) URLQuery ¶
func (r SnapshotNewParams) URLQuery() (v url.Values)
URLQuery serializes SnapshotNewParams's query parameters as `url.Values`.
type SnapshotNewParamsAddScriptTag ¶
type SnapshotNewParamsAddScriptTag struct {
ID param.Field[string] `json:"id"`
Content param.Field[string] `json:"content"`
Type param.Field[string] `json:"type"`
URL param.Field[string] `json:"url"`
}
func (SnapshotNewParamsAddScriptTag) MarshalJSON ¶
func (r SnapshotNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsAddStyleTag ¶
type SnapshotNewParamsAddStyleTag struct {
Content param.Field[string] `json:"content"`
URL param.Field[string] `json:"url"`
}
func (SnapshotNewParamsAddStyleTag) MarshalJSON ¶
func (r SnapshotNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsAllowResourceType ¶
type SnapshotNewParamsAllowResourceType string
const ( SnapshotNewParamsAllowResourceTypeDocument SnapshotNewParamsAllowResourceType = "document" SnapshotNewParamsAllowResourceTypeStylesheet SnapshotNewParamsAllowResourceType = "stylesheet" SnapshotNewParamsAllowResourceTypeImage SnapshotNewParamsAllowResourceType = "image" SnapshotNewParamsAllowResourceTypeMedia SnapshotNewParamsAllowResourceType = "media" SnapshotNewParamsAllowResourceTypeFont SnapshotNewParamsAllowResourceType = "font" SnapshotNewParamsAllowResourceTypeScript SnapshotNewParamsAllowResourceType = "script" SnapshotNewParamsAllowResourceTypeTexttrack SnapshotNewParamsAllowResourceType = "texttrack" SnapshotNewParamsAllowResourceTypeXHR SnapshotNewParamsAllowResourceType = "xhr" SnapshotNewParamsAllowResourceTypeFetch SnapshotNewParamsAllowResourceType = "fetch" SnapshotNewParamsAllowResourceTypePrefetch SnapshotNewParamsAllowResourceType = "prefetch" SnapshotNewParamsAllowResourceTypeEventsource SnapshotNewParamsAllowResourceType = "eventsource" SnapshotNewParamsAllowResourceTypeWebsocket SnapshotNewParamsAllowResourceType = "websocket" SnapshotNewParamsAllowResourceTypeManifest SnapshotNewParamsAllowResourceType = "manifest" SnapshotNewParamsAllowResourceTypeSignedexchange SnapshotNewParamsAllowResourceType = "signedexchange" SnapshotNewParamsAllowResourceTypePing SnapshotNewParamsAllowResourceType = "ping" SnapshotNewParamsAllowResourceTypeCspviolationreport SnapshotNewParamsAllowResourceType = "cspviolationreport" SnapshotNewParamsAllowResourceTypePreflight SnapshotNewParamsAllowResourceType = "preflight" SnapshotNewParamsAllowResourceTypeOther SnapshotNewParamsAllowResourceType = "other" )
func (SnapshotNewParamsAllowResourceType) IsKnown ¶
func (r SnapshotNewParamsAllowResourceType) IsKnown() bool
type SnapshotNewParamsAuthenticate ¶
type SnapshotNewParamsAuthenticate struct {
Password param.Field[string] `json:"password,required"`
Username param.Field[string] `json:"username,required"`
}
Provide credentials for HTTP authentication.
func (SnapshotNewParamsAuthenticate) MarshalJSON ¶
func (r SnapshotNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsCookie ¶
type SnapshotNewParamsCookie struct {
Name param.Field[string] `json:"name,required"`
Value param.Field[string] `json:"value,required"`
Domain param.Field[string] `json:"domain"`
Expires param.Field[float64] `json:"expires"`
HTTPOnly param.Field[bool] `json:"httpOnly"`
PartitionKey param.Field[string] `json:"partitionKey"`
Path param.Field[string] `json:"path"`
Priority param.Field[SnapshotNewParamsCookiesPriority] `json:"priority"`
SameParty param.Field[bool] `json:"sameParty"`
SameSite param.Field[SnapshotNewParamsCookiesSameSite] `json:"sameSite"`
Secure param.Field[bool] `json:"secure"`
SourcePort param.Field[float64] `json:"sourcePort"`
SourceScheme param.Field[SnapshotNewParamsCookiesSourceScheme] `json:"sourceScheme"`
URL param.Field[string] `json:"url"`
}
func (SnapshotNewParamsCookie) MarshalJSON ¶
func (r SnapshotNewParamsCookie) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsCookiesPriority ¶
type SnapshotNewParamsCookiesPriority string
const ( SnapshotNewParamsCookiesPriorityLow SnapshotNewParamsCookiesPriority = "Low" SnapshotNewParamsCookiesPriorityMedium SnapshotNewParamsCookiesPriority = "Medium" SnapshotNewParamsCookiesPriorityHigh SnapshotNewParamsCookiesPriority = "High" )
func (SnapshotNewParamsCookiesPriority) IsKnown ¶
func (r SnapshotNewParamsCookiesPriority) IsKnown() bool
type SnapshotNewParamsCookiesSameSite ¶
type SnapshotNewParamsCookiesSameSite string
const ( SnapshotNewParamsCookiesSameSiteStrict SnapshotNewParamsCookiesSameSite = "Strict" SnapshotNewParamsCookiesSameSiteLax SnapshotNewParamsCookiesSameSite = "Lax" SnapshotNewParamsCookiesSameSiteNone SnapshotNewParamsCookiesSameSite = "None" )
func (SnapshotNewParamsCookiesSameSite) IsKnown ¶
func (r SnapshotNewParamsCookiesSameSite) IsKnown() bool
type SnapshotNewParamsCookiesSourceScheme ¶
type SnapshotNewParamsCookiesSourceScheme string
const ( SnapshotNewParamsCookiesSourceSchemeUnset SnapshotNewParamsCookiesSourceScheme = "Unset" SnapshotNewParamsCookiesSourceSchemeNonSecure SnapshotNewParamsCookiesSourceScheme = "NonSecure" SnapshotNewParamsCookiesSourceSchemeSecure SnapshotNewParamsCookiesSourceScheme = "Secure" )
func (SnapshotNewParamsCookiesSourceScheme) IsKnown ¶
func (r SnapshotNewParamsCookiesSourceScheme) IsKnown() bool
type SnapshotNewParamsGotoOptions ¶
type SnapshotNewParamsGotoOptions struct {
Referer param.Field[string] `json:"referer"`
ReferrerPolicy param.Field[string] `json:"referrerPolicy"`
Timeout param.Field[float64] `json:"timeout"`
WaitUntil param.Field[SnapshotNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"`
}
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (SnapshotNewParamsGotoOptions) MarshalJSON ¶
func (r SnapshotNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsGotoOptionsWaitUntilArray ¶
type SnapshotNewParamsGotoOptionsWaitUntilArray []SnapshotNewParamsGotoOptionsWaitUntilArrayItem
type SnapshotNewParamsGotoOptionsWaitUntilArrayItem ¶
type SnapshotNewParamsGotoOptionsWaitUntilArrayItem string
const ( SnapshotNewParamsGotoOptionsWaitUntilArrayItemLoad SnapshotNewParamsGotoOptionsWaitUntilArrayItem = "load" SnapshotNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded SnapshotNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" SnapshotNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 SnapshotNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" SnapshotNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 SnapshotNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (SnapshotNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶
func (r SnapshotNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type SnapshotNewParamsGotoOptionsWaitUntilString ¶
type SnapshotNewParamsGotoOptionsWaitUntilString string
const ( SnapshotNewParamsGotoOptionsWaitUntilStringLoad SnapshotNewParamsGotoOptionsWaitUntilString = "load" SnapshotNewParamsGotoOptionsWaitUntilStringDomcontentloaded SnapshotNewParamsGotoOptionsWaitUntilString = "domcontentloaded" SnapshotNewParamsGotoOptionsWaitUntilStringNetworkidle0 SnapshotNewParamsGotoOptionsWaitUntilString = "networkidle0" SnapshotNewParamsGotoOptionsWaitUntilStringNetworkidle2 SnapshotNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (SnapshotNewParamsGotoOptionsWaitUntilString) IsKnown ¶
func (r SnapshotNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type SnapshotNewParamsGotoOptionsWaitUntilUnion ¶
type SnapshotNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.SnapshotNewParamsGotoOptionsWaitUntilString, browser_rendering.SnapshotNewParamsGotoOptionsWaitUntilArray.
type SnapshotNewParamsRejectResourceType ¶
type SnapshotNewParamsRejectResourceType string
const ( SnapshotNewParamsRejectResourceTypeDocument SnapshotNewParamsRejectResourceType = "document" SnapshotNewParamsRejectResourceTypeStylesheet SnapshotNewParamsRejectResourceType = "stylesheet" SnapshotNewParamsRejectResourceTypeImage SnapshotNewParamsRejectResourceType = "image" SnapshotNewParamsRejectResourceTypeMedia SnapshotNewParamsRejectResourceType = "media" SnapshotNewParamsRejectResourceTypeFont SnapshotNewParamsRejectResourceType = "font" SnapshotNewParamsRejectResourceTypeScript SnapshotNewParamsRejectResourceType = "script" SnapshotNewParamsRejectResourceTypeTexttrack SnapshotNewParamsRejectResourceType = "texttrack" SnapshotNewParamsRejectResourceTypeXHR SnapshotNewParamsRejectResourceType = "xhr" SnapshotNewParamsRejectResourceTypeFetch SnapshotNewParamsRejectResourceType = "fetch" SnapshotNewParamsRejectResourceTypePrefetch SnapshotNewParamsRejectResourceType = "prefetch" SnapshotNewParamsRejectResourceTypeEventsource SnapshotNewParamsRejectResourceType = "eventsource" SnapshotNewParamsRejectResourceTypeWebsocket SnapshotNewParamsRejectResourceType = "websocket" SnapshotNewParamsRejectResourceTypeManifest SnapshotNewParamsRejectResourceType = "manifest" SnapshotNewParamsRejectResourceTypeSignedexchange SnapshotNewParamsRejectResourceType = "signedexchange" SnapshotNewParamsRejectResourceTypePing SnapshotNewParamsRejectResourceType = "ping" SnapshotNewParamsRejectResourceTypeCspviolationreport SnapshotNewParamsRejectResourceType = "cspviolationreport" SnapshotNewParamsRejectResourceTypePreflight SnapshotNewParamsRejectResourceType = "preflight" SnapshotNewParamsRejectResourceTypeOther SnapshotNewParamsRejectResourceType = "other" )
func (SnapshotNewParamsRejectResourceType) IsKnown ¶
func (r SnapshotNewParamsRejectResourceType) IsKnown() bool
type SnapshotNewParamsScreenshotOptions ¶
type SnapshotNewParamsScreenshotOptions struct {
CaptureBeyondViewport param.Field[bool] `json:"captureBeyondViewport"`
Clip param.Field[SnapshotNewParamsScreenshotOptionsClip] `json:"clip"`
FromSurface param.Field[bool] `json:"fromSurface"`
FullPage param.Field[bool] `json:"fullPage"`
OmitBackground param.Field[bool] `json:"omitBackground"`
OptimizeForSpeed param.Field[bool] `json:"optimizeForSpeed"`
Quality param.Field[float64] `json:"quality"`
Type param.Field[SnapshotNewParamsScreenshotOptionsType] `json:"type"`
}
func (SnapshotNewParamsScreenshotOptions) MarshalJSON ¶
func (r SnapshotNewParamsScreenshotOptions) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsScreenshotOptionsClip ¶
type SnapshotNewParamsScreenshotOptionsClip struct {
Height param.Field[float64] `json:"height,required"`
Width param.Field[float64] `json:"width,required"`
X param.Field[float64] `json:"x,required"`
Y param.Field[float64] `json:"y,required"`
Scale param.Field[float64] `json:"scale"`
}
func (SnapshotNewParamsScreenshotOptionsClip) MarshalJSON ¶
func (r SnapshotNewParamsScreenshotOptionsClip) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsScreenshotOptionsType ¶
type SnapshotNewParamsScreenshotOptionsType string
const ( SnapshotNewParamsScreenshotOptionsTypePNG SnapshotNewParamsScreenshotOptionsType = "png" SnapshotNewParamsScreenshotOptionsTypeJPEG SnapshotNewParamsScreenshotOptionsType = "jpeg" SnapshotNewParamsScreenshotOptionsTypeWebP SnapshotNewParamsScreenshotOptionsType = "webp" )
func (SnapshotNewParamsScreenshotOptionsType) IsKnown ¶
func (r SnapshotNewParamsScreenshotOptionsType) IsKnown() bool
type SnapshotNewParamsViewport ¶
type SnapshotNewParamsViewport struct {
Height param.Field[float64] `json:"height,required"`
Width param.Field[float64] `json:"width,required"`
DeviceScaleFactor param.Field[float64] `json:"deviceScaleFactor"`
HasTouch param.Field[bool] `json:"hasTouch"`
IsLandscape param.Field[bool] `json:"isLandscape"`
IsMobile param.Field[bool] `json:"isMobile"`
}
Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
func (SnapshotNewParamsViewport) MarshalJSON ¶
func (r SnapshotNewParamsViewport) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsWaitForSelector ¶
type SnapshotNewParamsWaitForSelector struct {
Selector param.Field[string] `json:"selector,required"`
Hidden param.Field[SnapshotNewParamsWaitForSelectorHidden] `json:"hidden"`
Timeout param.Field[float64] `json:"timeout"`
Visible param.Field[SnapshotNewParamsWaitForSelectorVisible] `json:"visible"`
}
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (SnapshotNewParamsWaitForSelector) MarshalJSON ¶
func (r SnapshotNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsWaitForSelectorHidden ¶
type SnapshotNewParamsWaitForSelectorHidden bool
const (
SnapshotNewParamsWaitForSelectorHiddenTrue SnapshotNewParamsWaitForSelectorHidden = true
)
func (SnapshotNewParamsWaitForSelectorHidden) IsKnown ¶
func (r SnapshotNewParamsWaitForSelectorHidden) IsKnown() bool
type SnapshotNewParamsWaitForSelectorVisible ¶
type SnapshotNewParamsWaitForSelectorVisible bool
const (
SnapshotNewParamsWaitForSelectorVisibleTrue SnapshotNewParamsWaitForSelectorVisible = true
)
func (SnapshotNewParamsWaitForSelectorVisible) IsKnown ¶
func (r SnapshotNewParamsWaitForSelectorVisible) IsKnown() bool
type SnapshotNewResponse ¶
type SnapshotNewResponse struct {
// HTML content
Content string `json:"content,required"`
// Base64 encoded image
Screenshot string `json:"screenshot,required"`
JSON snapshotNewResponseJSON `json:"-"`
}
func (*SnapshotNewResponse) UnmarshalJSON ¶
func (r *SnapshotNewResponse) UnmarshalJSON(data []byte) (err error)
type SnapshotNewResponseEnvelope ¶
type SnapshotNewResponseEnvelope struct {
// Response status
Status bool `json:"status,required"`
Errors []SnapshotNewResponseEnvelopeErrors `json:"errors"`
Result SnapshotNewResponse `json:"result"`
JSON snapshotNewResponseEnvelopeJSON `json:"-"`
}
func (*SnapshotNewResponseEnvelope) UnmarshalJSON ¶
func (r *SnapshotNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type SnapshotNewResponseEnvelopeErrors ¶
type SnapshotNewResponseEnvelopeErrors struct {
// Error code
Code float64 `json:"code,required"`
// Error Message
Message string `json:"message,required"`
JSON snapshotNewResponseEnvelopeErrorsJSON `json:"-"`
}
func (*SnapshotNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *SnapshotNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type SnapshotService ¶
type SnapshotService struct {
Options []option.RequestOption
}
SnapshotService contains methods and other services that help with interacting with the cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSnapshotService method instead.
func NewSnapshotService ¶
func NewSnapshotService(opts ...option.RequestOption) (r *SnapshotService)
NewSnapshotService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SnapshotService) New ¶
func (r *SnapshotService) New(ctx context.Context, params SnapshotNewParams, opts ...option.RequestOption) (res *SnapshotNewResponse, err error)
Returns the page's HTML content and screenshot. Control page loading with `gotoOptions` and `waitFor*` options. Customize screenshots with `viewport`, `fullPage`, `clip` and others.
type SortDirection ¶
type SortDirection = shared.SortDirection
Direction to order DNS records in.
This is an alias to an internal type.
type SubscriptionFrequency ¶
type SubscriptionFrequency = shared.SubscriptionFrequency
How often the subscription is renewed automatically.
This is an alias to an internal type.
type SubscriptionParam ¶
type SubscriptionParam = shared.SubscriptionParam
This is an alias to an internal type.
type SubscriptionState ¶
type SubscriptionState = shared.SubscriptionState
The state that the subscription is in.
This is an alias to an internal type.
type TokenCondition ¶
type TokenCondition = shared.TokenCondition
This is an alias to an internal type.
type TokenConditionCIDRList ¶
type TokenConditionCIDRList = shared.TokenConditionCIDRList
IPv4/IPv6 CIDR.
This is an alias to an internal type.
type TokenConditionCIDRListParam ¶
type TokenConditionCIDRListParam = shared.TokenConditionCIDRListParam
IPv4/IPv6 CIDR.
This is an alias to an internal type.
type TokenConditionParam ¶
type TokenConditionParam = shared.TokenConditionParam
This is an alias to an internal type.
type TokenConditionRequestIP ¶
type TokenConditionRequestIP = shared.TokenConditionRequestIP
Client IP restrictions.
This is an alias to an internal type.
type TokenConditionRequestIPParam ¶
type TokenConditionRequestIPParam = shared.TokenConditionRequestIPParam
Client IP restrictions.
This is an alias to an internal type.
type TokenPolicyEffect ¶
type TokenPolicyEffect = shared.TokenPolicyEffect
Allow or deny operations against the resources.
This is an alias to an internal type.
type TokenPolicyParam ¶
type TokenPolicyParam = shared.TokenPolicyParam
This is an alias to an internal type.
type TokenPolicyPermissionGroup ¶
type TokenPolicyPermissionGroup = shared.TokenPolicyPermissionGroup
A named group of permissions that map to a group of operations against resources.
This is an alias to an internal type.
type TokenPolicyPermissionGroupParam ¶
type TokenPolicyPermissionGroupParam = shared.TokenPolicyPermissionGroupParam
A named group of permissions that map to a group of operations against resources.
This is an alias to an internal type.
type TokenPolicyPermissionGroupsMeta ¶
type TokenPolicyPermissionGroupsMeta = shared.TokenPolicyPermissionGroupsMeta
Attributes associated to the permission group.
This is an alias to an internal type.
type TokenPolicyPermissionGroupsMetaParam ¶
type TokenPolicyPermissionGroupsMetaParam = shared.TokenPolicyPermissionGroupsMetaParam
Attributes associated to the permission group.
This is an alias to an internal type.
type TokenStatus ¶
type TokenStatus = shared.TokenStatus
Status of the token.
This is an alias to an internal type.
type TokenValue ¶
type TokenValue = shared.TokenValue
The token value.
This is an alias to an internal type.