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 CloudflareTunnelConfigSrc
- 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 ContentNewResponseEnvelopeMeta
- type ContentService
- type Error
- type ErrorData
- type ErrorDataSource
- type JsonNewParams
- type JsonNewParamsAddScriptTag
- type JsonNewParamsAddStyleTag
- type JsonNewParamsAllowResourceType
- type JsonNewParamsAuthenticate
- type JsonNewParamsCookie
- type JsonNewParamsCookiesPriority
- type JsonNewParamsCookiesSameSite
- type JsonNewParamsCookiesSourceScheme
- type JsonNewParamsCustomAI
- type JsonNewParamsGotoOptions
- type JsonNewParamsGotoOptionsWaitUntilArray
- type JsonNewParamsGotoOptionsWaitUntilArrayItem
- type JsonNewParamsGotoOptionsWaitUntilString
- type JsonNewParamsGotoOptionsWaitUntilUnion
- type JsonNewParamsRejectResourceType
- type JsonNewParamsResponseFormat
- type JsonNewParamsResponseFormatJsonSchemaArray
- type JsonNewParamsResponseFormatJsonSchemaUnion
- type JsonNewParamsViewport
- type JsonNewParamsWaitForSelector
- type JsonNewParamsWaitForSelectorHidden
- type JsonNewParamsWaitForSelectorVisible
- type JsonNewResponse
- type JsonNewResponseEnvelope
- type JsonNewResponseEnvelopeErrors
- type JsonService
- type LinkNewParams
- type LinkNewParamsAddScriptTag
- type LinkNewParamsAddStyleTag
- type LinkNewParamsAllowResourceType
- type LinkNewParamsAuthenticate
- type LinkNewParamsCookie
- type LinkNewParamsCookiesPriority
- type LinkNewParamsCookiesSameSite
- type LinkNewParamsCookiesSourceScheme
- type LinkNewParamsGotoOptions
- type LinkNewParamsGotoOptionsWaitUntilArray
- type LinkNewParamsGotoOptionsWaitUntilArrayItem
- type LinkNewParamsGotoOptionsWaitUntilString
- type LinkNewParamsGotoOptionsWaitUntilUnion
- type LinkNewParamsRejectResourceType
- type LinkNewParamsViewport
- type LinkNewParamsWaitForSelector
- type LinkNewParamsWaitForSelectorHidden
- type LinkNewParamsWaitForSelectorVisible
- type LinkNewResponseEnvelope
- type LinkNewResponseEnvelopeErrors
- type LinkService
- type MarkdownNewParams
- type MarkdownNewParamsAddScriptTag
- type MarkdownNewParamsAddStyleTag
- type MarkdownNewParamsAllowResourceType
- type MarkdownNewParamsAuthenticate
- type MarkdownNewParamsCookie
- type MarkdownNewParamsCookiesPriority
- type MarkdownNewParamsCookiesSameSite
- type MarkdownNewParamsCookiesSourceScheme
- type MarkdownNewParamsGotoOptions
- type MarkdownNewParamsGotoOptionsWaitUntilArray
- type MarkdownNewParamsGotoOptionsWaitUntilArrayItem
- type MarkdownNewParamsGotoOptionsWaitUntilString
- type MarkdownNewParamsGotoOptionsWaitUntilUnion
- type MarkdownNewParamsRejectResourceType
- type MarkdownNewParamsViewport
- type MarkdownNewParamsWaitForSelector
- type MarkdownNewParamsWaitForSelectorHidden
- type MarkdownNewParamsWaitForSelectorVisible
- type MarkdownNewResponseEnvelope
- type MarkdownNewResponseEnvelopeErrors
- type MarkdownService
- 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 PDFNewParamsPDFOptions
- type PDFNewParamsPDFOptionsFormat
- type PDFNewParamsPDFOptionsHeightUnion
- type PDFNewParamsPDFOptionsMargin
- type PDFNewParamsPDFOptionsMarginBottomUnion
- type PDFNewParamsPDFOptionsMarginLeftUnion
- type PDFNewParamsPDFOptionsMarginRightUnion
- type PDFNewParamsPDFOptionsMarginTopUnion
- type PDFNewParamsPDFOptionsWidthUnion
- 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 ResponseInfoSource
- 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 ScrapeNewResponseResults
- type ScrapeNewResponseResultsAttribute
- 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 TokenPolicyResourcesIAMResourcesTypeObjectNested
- type TokenPolicyResourcesIAMResourcesTypeObjectNestedParam
- type TokenPolicyResourcesIAMResourcesTypeObjectString
- type TokenPolicyResourcesIAMResourcesTypeObjectStringParam
- type TokenPolicyResourcesUnion
- type TokenPolicyResourcesUnionParam
- 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 CloudflareTunnelConfigSrcCloudflare = shared.CloudflareTunnelConfigSrcCloudflare
This is an alias to an internal value.
const CloudflareTunnelConfigSrcLocal = shared.CloudflareTunnelConfigSrcLocal
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 Json *JsonService Links *LinkService Markdown *MarkdownService }
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 CloudflareTunnelConfigSrc ¶
type CloudflareTunnelConfigSrc = shared.CloudflareTunnelConfigSrc
Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard.
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"` // The maximum duration allowed for the browser action to complete after the page // has loaded (such as taking screenshots, extracting content, or generating PDFs). // If this time limit is exceeded, the action stops and returns a timeout error. ActionTimeout param.Field[float64] `json:"actionTimeout"` // 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 { Meta ContentNewResponseEnvelopeMeta `json:"meta,required"` // 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 ContentNewResponseEnvelopeMeta ¶
type ContentNewResponseEnvelopeMeta struct { Status float64 `json:"status,required"` Title string `json:"title,required"` JSON contentNewResponseEnvelopeMetaJSON `json:"-"` }
func (*ContentNewResponseEnvelopeMeta) UnmarshalJSON ¶
func (r *ContentNewResponseEnvelopeMeta) 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 JsonNewParams ¶
type JsonNewParams 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"` // The maximum duration allowed for the browser action to complete after the page // has loaded (such as taking screenshots, extracting content, or generating PDFs). // If this time limit is exceeded, the action stops and returns a timeout error. ActionTimeout param.Field[float64] `json:"actionTimeout"` // Adds a `<script>` tag into the page with the desired URL or content. AddScriptTag param.Field[[]JsonNewParamsAddScriptTag] `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[[]JsonNewParamsAddStyleTag] `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[[]JsonNewParamsAllowResourceType] `json:"allowResourceTypes"` // Provide credentials for HTTP authentication. Authenticate param.Field[JsonNewParamsAuthenticate] `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[[]JsonNewParamsCookie] `json:"cookies"` // Optional list of custom AI models to use for the request. The models will be // tried in the order provided, and in case a model returns an error, the next one // will be used as fallback. CustomAI param.Field[[]JsonNewParamsCustomAI] `json:"custom_ai"` EmulateMediaType param.Field[string] `json:"emulateMediaType"` // Check [options](https://pptr.dev/api/puppeteer.gotooptions). GotoOptions param.Field[JsonNewParamsGotoOptions] `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"` Prompt param.Field[string] `json:"prompt"` // 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[[]JsonNewParamsRejectResourceType] `json:"rejectResourceTypes"` ResponseFormat param.Field[JsonNewParamsResponseFormat] `json:"response_format"` 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[JsonNewParamsViewport] `json:"viewport"` // Wait for the selector to appear in page. Check // [options](https://pptr.dev/api/puppeteer.page.waitforselector). WaitForSelector param.Field[JsonNewParamsWaitForSelector] `json:"waitForSelector"` // Waits for a specified timeout before continuing. WaitForTimeout param.Field[float64] `json:"waitForTimeout"` }
func (JsonNewParams) MarshalJSON ¶
func (r JsonNewParams) MarshalJSON() (data []byte, err error)
func (JsonNewParams) URLQuery ¶
func (r JsonNewParams) URLQuery() (v url.Values)
URLQuery serializes JsonNewParams's query parameters as `url.Values`.
type JsonNewParamsAddScriptTag ¶
type JsonNewParamsAddScriptTag 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 (JsonNewParamsAddScriptTag) MarshalJSON ¶
func (r JsonNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type JsonNewParamsAddStyleTag ¶
type JsonNewParamsAddStyleTag struct { Content param.Field[string] `json:"content"` URL param.Field[string] `json:"url"` }
func (JsonNewParamsAddStyleTag) MarshalJSON ¶
func (r JsonNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type JsonNewParamsAllowResourceType ¶
type JsonNewParamsAllowResourceType string
const ( JsonNewParamsAllowResourceTypeDocument JsonNewParamsAllowResourceType = "document" JsonNewParamsAllowResourceTypeStylesheet JsonNewParamsAllowResourceType = "stylesheet" JsonNewParamsAllowResourceTypeImage JsonNewParamsAllowResourceType = "image" JsonNewParamsAllowResourceTypeMedia JsonNewParamsAllowResourceType = "media" JsonNewParamsAllowResourceTypeFont JsonNewParamsAllowResourceType = "font" JsonNewParamsAllowResourceTypeScript JsonNewParamsAllowResourceType = "script" JsonNewParamsAllowResourceTypeTexttrack JsonNewParamsAllowResourceType = "texttrack" JsonNewParamsAllowResourceTypeXHR JsonNewParamsAllowResourceType = "xhr" JsonNewParamsAllowResourceTypeFetch JsonNewParamsAllowResourceType = "fetch" JsonNewParamsAllowResourceTypePrefetch JsonNewParamsAllowResourceType = "prefetch" JsonNewParamsAllowResourceTypeEventsource JsonNewParamsAllowResourceType = "eventsource" JsonNewParamsAllowResourceTypeWebsocket JsonNewParamsAllowResourceType = "websocket" JsonNewParamsAllowResourceTypeManifest JsonNewParamsAllowResourceType = "manifest" JsonNewParamsAllowResourceTypeSignedexchange JsonNewParamsAllowResourceType = "signedexchange" JsonNewParamsAllowResourceTypePing JsonNewParamsAllowResourceType = "ping" JsonNewParamsAllowResourceTypeCspviolationreport JsonNewParamsAllowResourceType = "cspviolationreport" JsonNewParamsAllowResourceTypePreflight JsonNewParamsAllowResourceType = "preflight" JsonNewParamsAllowResourceTypeOther JsonNewParamsAllowResourceType = "other" )
func (JsonNewParamsAllowResourceType) IsKnown ¶
func (r JsonNewParamsAllowResourceType) IsKnown() bool
type JsonNewParamsAuthenticate ¶
type JsonNewParamsAuthenticate struct { Password param.Field[string] `json:"password,required"` Username param.Field[string] `json:"username,required"` }
Provide credentials for HTTP authentication.
func (JsonNewParamsAuthenticate) MarshalJSON ¶
func (r JsonNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type JsonNewParamsCookie ¶
type JsonNewParamsCookie 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[JsonNewParamsCookiesPriority] `json:"priority"` SameParty param.Field[bool] `json:"sameParty"` SameSite param.Field[JsonNewParamsCookiesSameSite] `json:"sameSite"` Secure param.Field[bool] `json:"secure"` SourcePort param.Field[float64] `json:"sourcePort"` SourceScheme param.Field[JsonNewParamsCookiesSourceScheme] `json:"sourceScheme"` URL param.Field[string] `json:"url"` }
func (JsonNewParamsCookie) MarshalJSON ¶
func (r JsonNewParamsCookie) MarshalJSON() (data []byte, err error)
type JsonNewParamsCookiesPriority ¶
type JsonNewParamsCookiesPriority string
const ( JsonNewParamsCookiesPriorityLow JsonNewParamsCookiesPriority = "Low" JsonNewParamsCookiesPriorityMedium JsonNewParamsCookiesPriority = "Medium" JsonNewParamsCookiesPriorityHigh JsonNewParamsCookiesPriority = "High" )
func (JsonNewParamsCookiesPriority) IsKnown ¶
func (r JsonNewParamsCookiesPriority) IsKnown() bool
type JsonNewParamsCookiesSameSite ¶
type JsonNewParamsCookiesSameSite string
const ( JsonNewParamsCookiesSameSiteStrict JsonNewParamsCookiesSameSite = "Strict" JsonNewParamsCookiesSameSiteLax JsonNewParamsCookiesSameSite = "Lax" JsonNewParamsCookiesSameSiteNone JsonNewParamsCookiesSameSite = "None" )
func (JsonNewParamsCookiesSameSite) IsKnown ¶
func (r JsonNewParamsCookiesSameSite) IsKnown() bool
type JsonNewParamsCookiesSourceScheme ¶
type JsonNewParamsCookiesSourceScheme string
const ( JsonNewParamsCookiesSourceSchemeUnset JsonNewParamsCookiesSourceScheme = "Unset" JsonNewParamsCookiesSourceSchemeNonSecure JsonNewParamsCookiesSourceScheme = "NonSecure" JsonNewParamsCookiesSourceSchemeSecure JsonNewParamsCookiesSourceScheme = "Secure" )
func (JsonNewParamsCookiesSourceScheme) IsKnown ¶
func (r JsonNewParamsCookiesSourceScheme) IsKnown() bool
type JsonNewParamsCustomAI ¶
type JsonNewParamsCustomAI struct { // Authorization token for the AI model: `Bearer <token>`. Authorization param.Field[string] `json:"authorization,required"` // AI model to use for the request. Must be formed as `<provider>/<model_name>`, // e.g. `workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast` Model param.Field[string] `json:"model,required"` }
func (JsonNewParamsCustomAI) MarshalJSON ¶
func (r JsonNewParamsCustomAI) MarshalJSON() (data []byte, err error)
type JsonNewParamsGotoOptions ¶
type JsonNewParamsGotoOptions struct { Referer param.Field[string] `json:"referer"` ReferrerPolicy param.Field[string] `json:"referrerPolicy"` Timeout param.Field[float64] `json:"timeout"` WaitUntil param.Field[JsonNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"` }
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (JsonNewParamsGotoOptions) MarshalJSON ¶
func (r JsonNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type JsonNewParamsGotoOptionsWaitUntilArray ¶
type JsonNewParamsGotoOptionsWaitUntilArray []JsonNewParamsGotoOptionsWaitUntilArrayItem
type JsonNewParamsGotoOptionsWaitUntilArrayItem ¶
type JsonNewParamsGotoOptionsWaitUntilArrayItem string
const ( JsonNewParamsGotoOptionsWaitUntilArrayItemLoad JsonNewParamsGotoOptionsWaitUntilArrayItem = "load" JsonNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded JsonNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" JsonNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 JsonNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" JsonNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 JsonNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (JsonNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶
func (r JsonNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type JsonNewParamsGotoOptionsWaitUntilString ¶
type JsonNewParamsGotoOptionsWaitUntilString string
const ( JsonNewParamsGotoOptionsWaitUntilStringLoad JsonNewParamsGotoOptionsWaitUntilString = "load" JsonNewParamsGotoOptionsWaitUntilStringDomcontentloaded JsonNewParamsGotoOptionsWaitUntilString = "domcontentloaded" JsonNewParamsGotoOptionsWaitUntilStringNetworkidle0 JsonNewParamsGotoOptionsWaitUntilString = "networkidle0" JsonNewParamsGotoOptionsWaitUntilStringNetworkidle2 JsonNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (JsonNewParamsGotoOptionsWaitUntilString) IsKnown ¶
func (r JsonNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type JsonNewParamsGotoOptionsWaitUntilUnion ¶
type JsonNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.JsonNewParamsGotoOptionsWaitUntilString, browser_rendering.JsonNewParamsGotoOptionsWaitUntilArray.
type JsonNewParamsRejectResourceType ¶
type JsonNewParamsRejectResourceType string
const ( JsonNewParamsRejectResourceTypeDocument JsonNewParamsRejectResourceType = "document" JsonNewParamsRejectResourceTypeStylesheet JsonNewParamsRejectResourceType = "stylesheet" JsonNewParamsRejectResourceTypeImage JsonNewParamsRejectResourceType = "image" JsonNewParamsRejectResourceTypeMedia JsonNewParamsRejectResourceType = "media" JsonNewParamsRejectResourceTypeFont JsonNewParamsRejectResourceType = "font" JsonNewParamsRejectResourceTypeScript JsonNewParamsRejectResourceType = "script" JsonNewParamsRejectResourceTypeTexttrack JsonNewParamsRejectResourceType = "texttrack" JsonNewParamsRejectResourceTypeXHR JsonNewParamsRejectResourceType = "xhr" JsonNewParamsRejectResourceTypeFetch JsonNewParamsRejectResourceType = "fetch" JsonNewParamsRejectResourceTypePrefetch JsonNewParamsRejectResourceType = "prefetch" JsonNewParamsRejectResourceTypeEventsource JsonNewParamsRejectResourceType = "eventsource" JsonNewParamsRejectResourceTypeWebsocket JsonNewParamsRejectResourceType = "websocket" JsonNewParamsRejectResourceTypeManifest JsonNewParamsRejectResourceType = "manifest" JsonNewParamsRejectResourceTypeSignedexchange JsonNewParamsRejectResourceType = "signedexchange" JsonNewParamsRejectResourceTypePing JsonNewParamsRejectResourceType = "ping" JsonNewParamsRejectResourceTypeCspviolationreport JsonNewParamsRejectResourceType = "cspviolationreport" JsonNewParamsRejectResourceTypePreflight JsonNewParamsRejectResourceType = "preflight" JsonNewParamsRejectResourceTypeOther JsonNewParamsRejectResourceType = "other" )
func (JsonNewParamsRejectResourceType) IsKnown ¶
func (r JsonNewParamsRejectResourceType) IsKnown() bool
type JsonNewParamsResponseFormat ¶
type JsonNewParamsResponseFormat struct { Type param.Field[string] `json:"type,required"` // Schema for the response format. More information here: // https://developers.cloudflare.com/workers-ai/json-mode/ JsonSchema param.Field[map[string]JsonNewParamsResponseFormatJsonSchemaUnion] `json:"json_schema"` }
func (JsonNewParamsResponseFormat) MarshalJSON ¶
func (r JsonNewParamsResponseFormat) MarshalJSON() (data []byte, err error)
type JsonNewParamsResponseFormatJsonSchemaArray ¶ added in v6.1.0
type JsonNewParamsResponseFormatJsonSchemaArray []string
func (JsonNewParamsResponseFormatJsonSchemaArray) ImplementsJsonNewParamsResponseFormatJsonSchemaUnion ¶ added in v6.1.0
func (r JsonNewParamsResponseFormatJsonSchemaArray) ImplementsJsonNewParamsResponseFormatJsonSchemaUnion()
type JsonNewParamsResponseFormatJsonSchemaUnion ¶ added in v6.1.0
type JsonNewParamsResponseFormatJsonSchemaUnion interface {
ImplementsJsonNewParamsResponseFormatJsonSchemaUnion()
}
Satisfied by shared.UnionString, shared.UnionFloat, shared.UnionBool, browser_rendering.JsonNewParamsResponseFormatJsonSchemaArray.
Use [Raw()] to specify an arbitrary value for this param
type JsonNewParamsViewport ¶
type JsonNewParamsViewport 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 (JsonNewParamsViewport) MarshalJSON ¶
func (r JsonNewParamsViewport) MarshalJSON() (data []byte, err error)
type JsonNewParamsWaitForSelector ¶
type JsonNewParamsWaitForSelector struct { Selector param.Field[string] `json:"selector,required"` Hidden param.Field[JsonNewParamsWaitForSelectorHidden] `json:"hidden"` Timeout param.Field[float64] `json:"timeout"` Visible param.Field[JsonNewParamsWaitForSelectorVisible] `json:"visible"` }
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (JsonNewParamsWaitForSelector) MarshalJSON ¶
func (r JsonNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type JsonNewParamsWaitForSelectorHidden ¶
type JsonNewParamsWaitForSelectorHidden bool
const (
JsonNewParamsWaitForSelectorHiddenTrue JsonNewParamsWaitForSelectorHidden = true
)
func (JsonNewParamsWaitForSelectorHidden) IsKnown ¶
func (r JsonNewParamsWaitForSelectorHidden) IsKnown() bool
type JsonNewParamsWaitForSelectorVisible ¶
type JsonNewParamsWaitForSelectorVisible bool
const (
JsonNewParamsWaitForSelectorVisibleTrue JsonNewParamsWaitForSelectorVisible = true
)
func (JsonNewParamsWaitForSelectorVisible) IsKnown ¶
func (r JsonNewParamsWaitForSelectorVisible) IsKnown() bool
type JsonNewResponse ¶
type JsonNewResponse map[string]interface{}
type JsonNewResponseEnvelope ¶
type JsonNewResponseEnvelope struct { Result JsonNewResponse `json:"result,required"` // Response status Status bool `json:"status,required"` Errors []JsonNewResponseEnvelopeErrors `json:"errors"` JSON jsonNewResponseEnvelopeJSON `json:"-"` }
func (*JsonNewResponseEnvelope) UnmarshalJSON ¶
func (r *JsonNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type JsonNewResponseEnvelopeErrors ¶
type JsonNewResponseEnvelopeErrors struct { // Error code Code float64 `json:"code,required"` // Error Message Message string `json:"message,required"` JSON jsonNewResponseEnvelopeErrorsJSON `json:"-"` }
func (*JsonNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *JsonNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type JsonService ¶
type JsonService struct {
Options []option.RequestOption
}
JsonService 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 NewJsonService method instead.
func NewJsonService ¶
func NewJsonService(opts ...option.RequestOption) (r *JsonService)
NewJsonService 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 (*JsonService) New ¶
func (r *JsonService) New(ctx context.Context, params JsonNewParams, opts ...option.RequestOption) (res *JsonNewResponse, err error)
Gets json from a webpage from a provided URL or HTML. Pass `prompt` or `schema` in the body. Control page loading with `gotoOptions` and `waitFor*` options.
type LinkNewParams ¶
type LinkNewParams 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"` // The maximum duration allowed for the browser action to complete after the page // has loaded (such as taking screenshots, extracting content, or generating PDFs). // If this time limit is exceeded, the action stops and returns a timeout error. ActionTimeout param.Field[float64] `json:"actionTimeout"` // Adds a `<script>` tag into the page with the desired URL or content. AddScriptTag param.Field[[]LinkNewParamsAddScriptTag] `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[[]LinkNewParamsAddStyleTag] `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[[]LinkNewParamsAllowResourceType] `json:"allowResourceTypes"` // Provide credentials for HTTP authentication. Authenticate param.Field[LinkNewParamsAuthenticate] `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[[]LinkNewParamsCookie] `json:"cookies"` EmulateMediaType param.Field[string] `json:"emulateMediaType"` ExcludeExternalLinks param.Field[bool] `json:"excludeExternalLinks"` // Check [options](https://pptr.dev/api/puppeteer.gotooptions). GotoOptions param.Field[LinkNewParamsGotoOptions] `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[[]LinkNewParamsRejectResourceType] `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[LinkNewParamsViewport] `json:"viewport"` VisibleLinksOnly param.Field[bool] `json:"visibleLinksOnly"` // Wait for the selector to appear in page. Check // [options](https://pptr.dev/api/puppeteer.page.waitforselector). WaitForSelector param.Field[LinkNewParamsWaitForSelector] `json:"waitForSelector"` // Waits for a specified timeout before continuing. WaitForTimeout param.Field[float64] `json:"waitForTimeout"` }
func (LinkNewParams) MarshalJSON ¶
func (r LinkNewParams) MarshalJSON() (data []byte, err error)
func (LinkNewParams) URLQuery ¶
func (r LinkNewParams) URLQuery() (v url.Values)
URLQuery serializes LinkNewParams's query parameters as `url.Values`.
type LinkNewParamsAddScriptTag ¶
type LinkNewParamsAddScriptTag 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 (LinkNewParamsAddScriptTag) MarshalJSON ¶
func (r LinkNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type LinkNewParamsAddStyleTag ¶
type LinkNewParamsAddStyleTag struct { Content param.Field[string] `json:"content"` URL param.Field[string] `json:"url"` }
func (LinkNewParamsAddStyleTag) MarshalJSON ¶
func (r LinkNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type LinkNewParamsAllowResourceType ¶
type LinkNewParamsAllowResourceType string
const ( LinkNewParamsAllowResourceTypeDocument LinkNewParamsAllowResourceType = "document" LinkNewParamsAllowResourceTypeStylesheet LinkNewParamsAllowResourceType = "stylesheet" LinkNewParamsAllowResourceTypeImage LinkNewParamsAllowResourceType = "image" LinkNewParamsAllowResourceTypeMedia LinkNewParamsAllowResourceType = "media" LinkNewParamsAllowResourceTypeFont LinkNewParamsAllowResourceType = "font" LinkNewParamsAllowResourceTypeScript LinkNewParamsAllowResourceType = "script" LinkNewParamsAllowResourceTypeTexttrack LinkNewParamsAllowResourceType = "texttrack" LinkNewParamsAllowResourceTypeXHR LinkNewParamsAllowResourceType = "xhr" LinkNewParamsAllowResourceTypeFetch LinkNewParamsAllowResourceType = "fetch" LinkNewParamsAllowResourceTypePrefetch LinkNewParamsAllowResourceType = "prefetch" LinkNewParamsAllowResourceTypeEventsource LinkNewParamsAllowResourceType = "eventsource" LinkNewParamsAllowResourceTypeWebsocket LinkNewParamsAllowResourceType = "websocket" LinkNewParamsAllowResourceTypeManifest LinkNewParamsAllowResourceType = "manifest" LinkNewParamsAllowResourceTypeSignedexchange LinkNewParamsAllowResourceType = "signedexchange" LinkNewParamsAllowResourceTypePing LinkNewParamsAllowResourceType = "ping" LinkNewParamsAllowResourceTypeCspviolationreport LinkNewParamsAllowResourceType = "cspviolationreport" LinkNewParamsAllowResourceTypePreflight LinkNewParamsAllowResourceType = "preflight" LinkNewParamsAllowResourceTypeOther LinkNewParamsAllowResourceType = "other" )
func (LinkNewParamsAllowResourceType) IsKnown ¶
func (r LinkNewParamsAllowResourceType) IsKnown() bool
type LinkNewParamsAuthenticate ¶
type LinkNewParamsAuthenticate struct { Password param.Field[string] `json:"password,required"` Username param.Field[string] `json:"username,required"` }
Provide credentials for HTTP authentication.
func (LinkNewParamsAuthenticate) MarshalJSON ¶
func (r LinkNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type LinkNewParamsCookie ¶
type LinkNewParamsCookie 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[LinkNewParamsCookiesPriority] `json:"priority"` SameParty param.Field[bool] `json:"sameParty"` SameSite param.Field[LinkNewParamsCookiesSameSite] `json:"sameSite"` Secure param.Field[bool] `json:"secure"` SourcePort param.Field[float64] `json:"sourcePort"` SourceScheme param.Field[LinkNewParamsCookiesSourceScheme] `json:"sourceScheme"` URL param.Field[string] `json:"url"` }
func (LinkNewParamsCookie) MarshalJSON ¶
func (r LinkNewParamsCookie) MarshalJSON() (data []byte, err error)
type LinkNewParamsCookiesPriority ¶
type LinkNewParamsCookiesPriority string
const ( LinkNewParamsCookiesPriorityLow LinkNewParamsCookiesPriority = "Low" LinkNewParamsCookiesPriorityMedium LinkNewParamsCookiesPriority = "Medium" LinkNewParamsCookiesPriorityHigh LinkNewParamsCookiesPriority = "High" )
func (LinkNewParamsCookiesPriority) IsKnown ¶
func (r LinkNewParamsCookiesPriority) IsKnown() bool
type LinkNewParamsCookiesSameSite ¶
type LinkNewParamsCookiesSameSite string
const ( LinkNewParamsCookiesSameSiteStrict LinkNewParamsCookiesSameSite = "Strict" LinkNewParamsCookiesSameSiteLax LinkNewParamsCookiesSameSite = "Lax" LinkNewParamsCookiesSameSiteNone LinkNewParamsCookiesSameSite = "None" )
func (LinkNewParamsCookiesSameSite) IsKnown ¶
func (r LinkNewParamsCookiesSameSite) IsKnown() bool
type LinkNewParamsCookiesSourceScheme ¶
type LinkNewParamsCookiesSourceScheme string
const ( LinkNewParamsCookiesSourceSchemeUnset LinkNewParamsCookiesSourceScheme = "Unset" LinkNewParamsCookiesSourceSchemeNonSecure LinkNewParamsCookiesSourceScheme = "NonSecure" LinkNewParamsCookiesSourceSchemeSecure LinkNewParamsCookiesSourceScheme = "Secure" )
func (LinkNewParamsCookiesSourceScheme) IsKnown ¶
func (r LinkNewParamsCookiesSourceScheme) IsKnown() bool
type LinkNewParamsGotoOptions ¶
type LinkNewParamsGotoOptions struct { Referer param.Field[string] `json:"referer"` ReferrerPolicy param.Field[string] `json:"referrerPolicy"` Timeout param.Field[float64] `json:"timeout"` WaitUntil param.Field[LinkNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"` }
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (LinkNewParamsGotoOptions) MarshalJSON ¶
func (r LinkNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type LinkNewParamsGotoOptionsWaitUntilArray ¶
type LinkNewParamsGotoOptionsWaitUntilArray []LinkNewParamsGotoOptionsWaitUntilArrayItem
type LinkNewParamsGotoOptionsWaitUntilArrayItem ¶
type LinkNewParamsGotoOptionsWaitUntilArrayItem string
const ( LinkNewParamsGotoOptionsWaitUntilArrayItemLoad LinkNewParamsGotoOptionsWaitUntilArrayItem = "load" LinkNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded LinkNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" LinkNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 LinkNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" LinkNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 LinkNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (LinkNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶
func (r LinkNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type LinkNewParamsGotoOptionsWaitUntilString ¶
type LinkNewParamsGotoOptionsWaitUntilString string
const ( LinkNewParamsGotoOptionsWaitUntilStringLoad LinkNewParamsGotoOptionsWaitUntilString = "load" LinkNewParamsGotoOptionsWaitUntilStringDomcontentloaded LinkNewParamsGotoOptionsWaitUntilString = "domcontentloaded" LinkNewParamsGotoOptionsWaitUntilStringNetworkidle0 LinkNewParamsGotoOptionsWaitUntilString = "networkidle0" LinkNewParamsGotoOptionsWaitUntilStringNetworkidle2 LinkNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (LinkNewParamsGotoOptionsWaitUntilString) IsKnown ¶
func (r LinkNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type LinkNewParamsGotoOptionsWaitUntilUnion ¶
type LinkNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.LinkNewParamsGotoOptionsWaitUntilString, browser_rendering.LinkNewParamsGotoOptionsWaitUntilArray.
type LinkNewParamsRejectResourceType ¶
type LinkNewParamsRejectResourceType string
const ( LinkNewParamsRejectResourceTypeDocument LinkNewParamsRejectResourceType = "document" LinkNewParamsRejectResourceTypeStylesheet LinkNewParamsRejectResourceType = "stylesheet" LinkNewParamsRejectResourceTypeImage LinkNewParamsRejectResourceType = "image" LinkNewParamsRejectResourceTypeMedia LinkNewParamsRejectResourceType = "media" LinkNewParamsRejectResourceTypeFont LinkNewParamsRejectResourceType = "font" LinkNewParamsRejectResourceTypeScript LinkNewParamsRejectResourceType = "script" LinkNewParamsRejectResourceTypeTexttrack LinkNewParamsRejectResourceType = "texttrack" LinkNewParamsRejectResourceTypeXHR LinkNewParamsRejectResourceType = "xhr" LinkNewParamsRejectResourceTypeFetch LinkNewParamsRejectResourceType = "fetch" LinkNewParamsRejectResourceTypePrefetch LinkNewParamsRejectResourceType = "prefetch" LinkNewParamsRejectResourceTypeEventsource LinkNewParamsRejectResourceType = "eventsource" LinkNewParamsRejectResourceTypeWebsocket LinkNewParamsRejectResourceType = "websocket" LinkNewParamsRejectResourceTypeManifest LinkNewParamsRejectResourceType = "manifest" LinkNewParamsRejectResourceTypeSignedexchange LinkNewParamsRejectResourceType = "signedexchange" LinkNewParamsRejectResourceTypePing LinkNewParamsRejectResourceType = "ping" LinkNewParamsRejectResourceTypeCspviolationreport LinkNewParamsRejectResourceType = "cspviolationreport" LinkNewParamsRejectResourceTypePreflight LinkNewParamsRejectResourceType = "preflight" LinkNewParamsRejectResourceTypeOther LinkNewParamsRejectResourceType = "other" )
func (LinkNewParamsRejectResourceType) IsKnown ¶
func (r LinkNewParamsRejectResourceType) IsKnown() bool
type LinkNewParamsViewport ¶
type LinkNewParamsViewport 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 (LinkNewParamsViewport) MarshalJSON ¶
func (r LinkNewParamsViewport) MarshalJSON() (data []byte, err error)
type LinkNewParamsWaitForSelector ¶
type LinkNewParamsWaitForSelector struct { Selector param.Field[string] `json:"selector,required"` Hidden param.Field[LinkNewParamsWaitForSelectorHidden] `json:"hidden"` Timeout param.Field[float64] `json:"timeout"` Visible param.Field[LinkNewParamsWaitForSelectorVisible] `json:"visible"` }
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (LinkNewParamsWaitForSelector) MarshalJSON ¶
func (r LinkNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type LinkNewParamsWaitForSelectorHidden ¶
type LinkNewParamsWaitForSelectorHidden bool
const (
LinkNewParamsWaitForSelectorHiddenTrue LinkNewParamsWaitForSelectorHidden = true
)
func (LinkNewParamsWaitForSelectorHidden) IsKnown ¶
func (r LinkNewParamsWaitForSelectorHidden) IsKnown() bool
type LinkNewParamsWaitForSelectorVisible ¶
type LinkNewParamsWaitForSelectorVisible bool
const (
LinkNewParamsWaitForSelectorVisibleTrue LinkNewParamsWaitForSelectorVisible = true
)
func (LinkNewParamsWaitForSelectorVisible) IsKnown ¶
func (r LinkNewParamsWaitForSelectorVisible) IsKnown() bool
type LinkNewResponseEnvelope ¶
type LinkNewResponseEnvelope struct { Result []string `json:"result,required"` // Response status Status bool `json:"status,required"` Errors []LinkNewResponseEnvelopeErrors `json:"errors"` JSON linkNewResponseEnvelopeJSON `json:"-"` }
func (*LinkNewResponseEnvelope) UnmarshalJSON ¶
func (r *LinkNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type LinkNewResponseEnvelopeErrors ¶
type LinkNewResponseEnvelopeErrors struct { // Error code Code float64 `json:"code,required"` // Error Message Message string `json:"message,required"` JSON linkNewResponseEnvelopeErrorsJSON `json:"-"` }
func (*LinkNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *LinkNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type LinkService ¶
type LinkService struct {
Options []option.RequestOption
}
LinkService 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 NewLinkService method instead.
func NewLinkService ¶
func NewLinkService(opts ...option.RequestOption) (r *LinkService)
NewLinkService 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 (*LinkService) New ¶
func (r *LinkService) New(ctx context.Context, params LinkNewParams, opts ...option.RequestOption) (res *[]string, err error)
Get links from a web page.
type MarkdownNewParams ¶
type MarkdownNewParams 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"` // The maximum duration allowed for the browser action to complete after the page // has loaded (such as taking screenshots, extracting content, or generating PDFs). // If this time limit is exceeded, the action stops and returns a timeout error. ActionTimeout param.Field[float64] `json:"actionTimeout"` // Adds a `<script>` tag into the page with the desired URL or content. AddScriptTag param.Field[[]MarkdownNewParamsAddScriptTag] `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[[]MarkdownNewParamsAddStyleTag] `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[[]MarkdownNewParamsAllowResourceType] `json:"allowResourceTypes"` // Provide credentials for HTTP authentication. Authenticate param.Field[MarkdownNewParamsAuthenticate] `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[[]MarkdownNewParamsCookie] `json:"cookies"` EmulateMediaType param.Field[string] `json:"emulateMediaType"` // Check [options](https://pptr.dev/api/puppeteer.gotooptions). GotoOptions param.Field[MarkdownNewParamsGotoOptions] `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[[]MarkdownNewParamsRejectResourceType] `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[MarkdownNewParamsViewport] `json:"viewport"` // Wait for the selector to appear in page. Check // [options](https://pptr.dev/api/puppeteer.page.waitforselector). WaitForSelector param.Field[MarkdownNewParamsWaitForSelector] `json:"waitForSelector"` // Waits for a specified timeout before continuing. WaitForTimeout param.Field[float64] `json:"waitForTimeout"` }
func (MarkdownNewParams) MarshalJSON ¶
func (r MarkdownNewParams) MarshalJSON() (data []byte, err error)
func (MarkdownNewParams) URLQuery ¶
func (r MarkdownNewParams) URLQuery() (v url.Values)
URLQuery serializes MarkdownNewParams's query parameters as `url.Values`.
type MarkdownNewParamsAddScriptTag ¶
type MarkdownNewParamsAddScriptTag 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 (MarkdownNewParamsAddScriptTag) MarshalJSON ¶
func (r MarkdownNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type MarkdownNewParamsAddStyleTag ¶
type MarkdownNewParamsAddStyleTag struct { Content param.Field[string] `json:"content"` URL param.Field[string] `json:"url"` }
func (MarkdownNewParamsAddStyleTag) MarshalJSON ¶
func (r MarkdownNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type MarkdownNewParamsAllowResourceType ¶
type MarkdownNewParamsAllowResourceType string
const ( MarkdownNewParamsAllowResourceTypeDocument MarkdownNewParamsAllowResourceType = "document" MarkdownNewParamsAllowResourceTypeStylesheet MarkdownNewParamsAllowResourceType = "stylesheet" MarkdownNewParamsAllowResourceTypeImage MarkdownNewParamsAllowResourceType = "image" MarkdownNewParamsAllowResourceTypeMedia MarkdownNewParamsAllowResourceType = "media" MarkdownNewParamsAllowResourceTypeFont MarkdownNewParamsAllowResourceType = "font" MarkdownNewParamsAllowResourceTypeScript MarkdownNewParamsAllowResourceType = "script" MarkdownNewParamsAllowResourceTypeTexttrack MarkdownNewParamsAllowResourceType = "texttrack" MarkdownNewParamsAllowResourceTypeXHR MarkdownNewParamsAllowResourceType = "xhr" MarkdownNewParamsAllowResourceTypeFetch MarkdownNewParamsAllowResourceType = "fetch" MarkdownNewParamsAllowResourceTypePrefetch MarkdownNewParamsAllowResourceType = "prefetch" MarkdownNewParamsAllowResourceTypeEventsource MarkdownNewParamsAllowResourceType = "eventsource" MarkdownNewParamsAllowResourceTypeWebsocket MarkdownNewParamsAllowResourceType = "websocket" MarkdownNewParamsAllowResourceTypeManifest MarkdownNewParamsAllowResourceType = "manifest" MarkdownNewParamsAllowResourceTypeSignedexchange MarkdownNewParamsAllowResourceType = "signedexchange" MarkdownNewParamsAllowResourceTypePing MarkdownNewParamsAllowResourceType = "ping" MarkdownNewParamsAllowResourceTypeCspviolationreport MarkdownNewParamsAllowResourceType = "cspviolationreport" MarkdownNewParamsAllowResourceTypePreflight MarkdownNewParamsAllowResourceType = "preflight" MarkdownNewParamsAllowResourceTypeOther MarkdownNewParamsAllowResourceType = "other" )
func (MarkdownNewParamsAllowResourceType) IsKnown ¶
func (r MarkdownNewParamsAllowResourceType) IsKnown() bool
type MarkdownNewParamsAuthenticate ¶
type MarkdownNewParamsAuthenticate struct { Password param.Field[string] `json:"password,required"` Username param.Field[string] `json:"username,required"` }
Provide credentials for HTTP authentication.
func (MarkdownNewParamsAuthenticate) MarshalJSON ¶
func (r MarkdownNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type MarkdownNewParamsCookie ¶
type MarkdownNewParamsCookie 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[MarkdownNewParamsCookiesPriority] `json:"priority"` SameParty param.Field[bool] `json:"sameParty"` SameSite param.Field[MarkdownNewParamsCookiesSameSite] `json:"sameSite"` Secure param.Field[bool] `json:"secure"` SourcePort param.Field[float64] `json:"sourcePort"` SourceScheme param.Field[MarkdownNewParamsCookiesSourceScheme] `json:"sourceScheme"` URL param.Field[string] `json:"url"` }
func (MarkdownNewParamsCookie) MarshalJSON ¶
func (r MarkdownNewParamsCookie) MarshalJSON() (data []byte, err error)
type MarkdownNewParamsCookiesPriority ¶
type MarkdownNewParamsCookiesPriority string
const ( MarkdownNewParamsCookiesPriorityLow MarkdownNewParamsCookiesPriority = "Low" MarkdownNewParamsCookiesPriorityMedium MarkdownNewParamsCookiesPriority = "Medium" MarkdownNewParamsCookiesPriorityHigh MarkdownNewParamsCookiesPriority = "High" )
func (MarkdownNewParamsCookiesPriority) IsKnown ¶
func (r MarkdownNewParamsCookiesPriority) IsKnown() bool
type MarkdownNewParamsCookiesSameSite ¶
type MarkdownNewParamsCookiesSameSite string
const ( MarkdownNewParamsCookiesSameSiteStrict MarkdownNewParamsCookiesSameSite = "Strict" MarkdownNewParamsCookiesSameSiteLax MarkdownNewParamsCookiesSameSite = "Lax" MarkdownNewParamsCookiesSameSiteNone MarkdownNewParamsCookiesSameSite = "None" )
func (MarkdownNewParamsCookiesSameSite) IsKnown ¶
func (r MarkdownNewParamsCookiesSameSite) IsKnown() bool
type MarkdownNewParamsCookiesSourceScheme ¶
type MarkdownNewParamsCookiesSourceScheme string
const ( MarkdownNewParamsCookiesSourceSchemeUnset MarkdownNewParamsCookiesSourceScheme = "Unset" MarkdownNewParamsCookiesSourceSchemeNonSecure MarkdownNewParamsCookiesSourceScheme = "NonSecure" MarkdownNewParamsCookiesSourceSchemeSecure MarkdownNewParamsCookiesSourceScheme = "Secure" )
func (MarkdownNewParamsCookiesSourceScheme) IsKnown ¶
func (r MarkdownNewParamsCookiesSourceScheme) IsKnown() bool
type MarkdownNewParamsGotoOptions ¶
type MarkdownNewParamsGotoOptions struct { Referer param.Field[string] `json:"referer"` ReferrerPolicy param.Field[string] `json:"referrerPolicy"` Timeout param.Field[float64] `json:"timeout"` WaitUntil param.Field[MarkdownNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"` }
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (MarkdownNewParamsGotoOptions) MarshalJSON ¶
func (r MarkdownNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type MarkdownNewParamsGotoOptionsWaitUntilArray ¶
type MarkdownNewParamsGotoOptionsWaitUntilArray []MarkdownNewParamsGotoOptionsWaitUntilArrayItem
type MarkdownNewParamsGotoOptionsWaitUntilArrayItem ¶
type MarkdownNewParamsGotoOptionsWaitUntilArrayItem string
const ( MarkdownNewParamsGotoOptionsWaitUntilArrayItemLoad MarkdownNewParamsGotoOptionsWaitUntilArrayItem = "load" MarkdownNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded MarkdownNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" MarkdownNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 MarkdownNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" MarkdownNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 MarkdownNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (MarkdownNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶
func (r MarkdownNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type MarkdownNewParamsGotoOptionsWaitUntilString ¶
type MarkdownNewParamsGotoOptionsWaitUntilString string
const ( MarkdownNewParamsGotoOptionsWaitUntilStringLoad MarkdownNewParamsGotoOptionsWaitUntilString = "load" MarkdownNewParamsGotoOptionsWaitUntilStringDomcontentloaded MarkdownNewParamsGotoOptionsWaitUntilString = "domcontentloaded" MarkdownNewParamsGotoOptionsWaitUntilStringNetworkidle0 MarkdownNewParamsGotoOptionsWaitUntilString = "networkidle0" MarkdownNewParamsGotoOptionsWaitUntilStringNetworkidle2 MarkdownNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (MarkdownNewParamsGotoOptionsWaitUntilString) IsKnown ¶
func (r MarkdownNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type MarkdownNewParamsGotoOptionsWaitUntilUnion ¶
type MarkdownNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.MarkdownNewParamsGotoOptionsWaitUntilString, browser_rendering.MarkdownNewParamsGotoOptionsWaitUntilArray.
type MarkdownNewParamsRejectResourceType ¶
type MarkdownNewParamsRejectResourceType string
const ( MarkdownNewParamsRejectResourceTypeDocument MarkdownNewParamsRejectResourceType = "document" MarkdownNewParamsRejectResourceTypeStylesheet MarkdownNewParamsRejectResourceType = "stylesheet" MarkdownNewParamsRejectResourceTypeImage MarkdownNewParamsRejectResourceType = "image" MarkdownNewParamsRejectResourceTypeMedia MarkdownNewParamsRejectResourceType = "media" MarkdownNewParamsRejectResourceTypeFont MarkdownNewParamsRejectResourceType = "font" MarkdownNewParamsRejectResourceTypeScript MarkdownNewParamsRejectResourceType = "script" MarkdownNewParamsRejectResourceTypeTexttrack MarkdownNewParamsRejectResourceType = "texttrack" MarkdownNewParamsRejectResourceTypeXHR MarkdownNewParamsRejectResourceType = "xhr" MarkdownNewParamsRejectResourceTypeFetch MarkdownNewParamsRejectResourceType = "fetch" MarkdownNewParamsRejectResourceTypePrefetch MarkdownNewParamsRejectResourceType = "prefetch" MarkdownNewParamsRejectResourceTypeEventsource MarkdownNewParamsRejectResourceType = "eventsource" MarkdownNewParamsRejectResourceTypeWebsocket MarkdownNewParamsRejectResourceType = "websocket" MarkdownNewParamsRejectResourceTypeManifest MarkdownNewParamsRejectResourceType = "manifest" MarkdownNewParamsRejectResourceTypeSignedexchange MarkdownNewParamsRejectResourceType = "signedexchange" MarkdownNewParamsRejectResourceTypePing MarkdownNewParamsRejectResourceType = "ping" MarkdownNewParamsRejectResourceTypeCspviolationreport MarkdownNewParamsRejectResourceType = "cspviolationreport" MarkdownNewParamsRejectResourceTypePreflight MarkdownNewParamsRejectResourceType = "preflight" MarkdownNewParamsRejectResourceTypeOther MarkdownNewParamsRejectResourceType = "other" )
func (MarkdownNewParamsRejectResourceType) IsKnown ¶
func (r MarkdownNewParamsRejectResourceType) IsKnown() bool
type MarkdownNewParamsViewport ¶
type MarkdownNewParamsViewport 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 (MarkdownNewParamsViewport) MarshalJSON ¶
func (r MarkdownNewParamsViewport) MarshalJSON() (data []byte, err error)
type MarkdownNewParamsWaitForSelector ¶
type MarkdownNewParamsWaitForSelector struct { Selector param.Field[string] `json:"selector,required"` Hidden param.Field[MarkdownNewParamsWaitForSelectorHidden] `json:"hidden"` Timeout param.Field[float64] `json:"timeout"` Visible param.Field[MarkdownNewParamsWaitForSelectorVisible] `json:"visible"` }
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (MarkdownNewParamsWaitForSelector) MarshalJSON ¶
func (r MarkdownNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type MarkdownNewParamsWaitForSelectorHidden ¶
type MarkdownNewParamsWaitForSelectorHidden bool
const (
MarkdownNewParamsWaitForSelectorHiddenTrue MarkdownNewParamsWaitForSelectorHidden = true
)
func (MarkdownNewParamsWaitForSelectorHidden) IsKnown ¶
func (r MarkdownNewParamsWaitForSelectorHidden) IsKnown() bool
type MarkdownNewParamsWaitForSelectorVisible ¶
type MarkdownNewParamsWaitForSelectorVisible bool
const (
MarkdownNewParamsWaitForSelectorVisibleTrue MarkdownNewParamsWaitForSelectorVisible = true
)
func (MarkdownNewParamsWaitForSelectorVisible) IsKnown ¶
func (r MarkdownNewParamsWaitForSelectorVisible) IsKnown() bool
type MarkdownNewResponseEnvelope ¶
type MarkdownNewResponseEnvelope struct { // Response status Status bool `json:"status,required"` Errors []MarkdownNewResponseEnvelopeErrors `json:"errors"` // Markdown Result string `json:"result"` JSON markdownNewResponseEnvelopeJSON `json:"-"` }
func (*MarkdownNewResponseEnvelope) UnmarshalJSON ¶
func (r *MarkdownNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type MarkdownNewResponseEnvelopeErrors ¶
type MarkdownNewResponseEnvelopeErrors struct { // Error code Code float64 `json:"code,required"` // Error Message Message string `json:"message,required"` JSON markdownNewResponseEnvelopeErrorsJSON `json:"-"` }
func (*MarkdownNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *MarkdownNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type MarkdownService ¶
type MarkdownService struct {
Options []option.RequestOption
}
MarkdownService 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 NewMarkdownService method instead.
func NewMarkdownService ¶
func NewMarkdownService(opts ...option.RequestOption) (r *MarkdownService)
NewMarkdownService 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 (*MarkdownService) New ¶
func (r *MarkdownService) New(ctx context.Context, params MarkdownNewParams, opts ...option.RequestOption) (res *string, err error)
Gets markdown of a webpage from provided URL or HTML. Control page loading with `gotoOptions` and `waitFor*` options.
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"` // The maximum duration allowed for the browser action to complete after the page // has loaded (such as taking screenshots, extracting content, or generating PDFs). // If this time limit is exceeded, the action stops and returns a timeout error. ActionTimeout param.Field[float64] `json:"actionTimeout"` // 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"` // Check [options](https://pptr.dev/api/puppeteer.pdfoptions). PDFOptions param.Field[PDFNewParamsPDFOptions] `json:"pdfOptions"` // 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 PDFNewParamsPDFOptions ¶
type PDFNewParamsPDFOptions struct { param.Field[bool] `json:"displayHeaderFooter"` FooterTemplate param.Field[string] `json:"footerTemplate"` // Paper format. Takes priority over width and height if set. Format param.Field[PDFNewParamsPDFOptionsFormat] `json:"format"` // HTML template for the print header. HeaderTemplate param.Field[string] `json:"headerTemplate"` // Sets the height of paper. Can be a number or string with unit. Height param.Field[PDFNewParamsPDFOptionsHeightUnion] `json:"height"` // Whether to print in landscape orientation. Landscape param.Field[bool] `json:"landscape"` // Set the PDF margins. Useful when setting header and footer. Margin param.Field[PDFNewParamsPDFOptionsMargin] `json:"margin"` // Hides default white background and allows generating pdfs with transparency. OmitBackground param.Field[bool] `json:"omitBackground"` // Generate document outline. Outline param.Field[bool] `json:"outline"` // Paper ranges to print, e.g. '1-5, 8, 11-13'. PageRanges param.Field[string] `json:"pageRanges"` // Give CSS @page size priority over other size declarations. PreferCSSPageSize param.Field[bool] `json:"preferCSSPageSize"` // Set to true to print background graphics. PrintBackground param.Field[bool] `json:"printBackground"` // Scales the rendering of the web page. Amount must be between 0.1 and 2. Scale param.Field[float64] `json:"scale"` // Generate tagged (accessible) PDF. Tagged param.Field[bool] `json:"tagged"` // Timeout in milliseconds. Timeout param.Field[float64] `json:"timeout"` // Sets the width of paper. Can be a number or string with unit. Width param.Field[PDFNewParamsPDFOptionsWidthUnion] `json:"width"` }DisplayHeaderFooter
Check [options](https://pptr.dev/api/puppeteer.pdfoptions).
func (PDFNewParamsPDFOptions) MarshalJSON ¶
func (r PDFNewParamsPDFOptions) MarshalJSON() (data []byte, err error)
type PDFNewParamsPDFOptionsFormat ¶
type PDFNewParamsPDFOptionsFormat string
Paper format. Takes priority over width and height if set.
const ( PDFNewParamsPDFOptionsFormatLetter PDFNewParamsPDFOptionsFormat = "letter" PDFNewParamsPDFOptionsFormatLegal PDFNewParamsPDFOptionsFormat = "legal" PDFNewParamsPDFOptionsFormatTabloid PDFNewParamsPDFOptionsFormat = "tabloid" PDFNewParamsPDFOptionsFormatLedger PDFNewParamsPDFOptionsFormat = "ledger" PDFNewParamsPDFOptionsFormatA0 PDFNewParamsPDFOptionsFormat = "a0" PDFNewParamsPDFOptionsFormatA1 PDFNewParamsPDFOptionsFormat = "a1" PDFNewParamsPDFOptionsFormatA2 PDFNewParamsPDFOptionsFormat = "a2" PDFNewParamsPDFOptionsFormatA3 PDFNewParamsPDFOptionsFormat = "a3" PDFNewParamsPDFOptionsFormatA4 PDFNewParamsPDFOptionsFormat = "a4" PDFNewParamsPDFOptionsFormatA5 PDFNewParamsPDFOptionsFormat = "a5" PDFNewParamsPDFOptionsFormatA6 PDFNewParamsPDFOptionsFormat = "a6" )
func (PDFNewParamsPDFOptionsFormat) IsKnown ¶
func (r PDFNewParamsPDFOptionsFormat) IsKnown() bool
type PDFNewParamsPDFOptionsHeightUnion ¶
type PDFNewParamsPDFOptionsHeightUnion interface {
ImplementsPDFNewParamsPDFOptionsHeightUnion()
}
Sets the height of paper. Can be a number or string with unit.
Satisfied by shared.UnionString, shared.UnionFloat.
type PDFNewParamsPDFOptionsMargin ¶
type PDFNewParamsPDFOptionsMargin struct { Bottom param.Field[PDFNewParamsPDFOptionsMarginBottomUnion] `json:"bottom"` Left param.Field[PDFNewParamsPDFOptionsMarginLeftUnion] `json:"left"` Right param.Field[PDFNewParamsPDFOptionsMarginRightUnion] `json:"right"` Top param.Field[PDFNewParamsPDFOptionsMarginTopUnion] `json:"top"` }
Set the PDF margins. Useful when setting header and footer.
func (PDFNewParamsPDFOptionsMargin) MarshalJSON ¶
func (r PDFNewParamsPDFOptionsMargin) MarshalJSON() (data []byte, err error)
type PDFNewParamsPDFOptionsMarginBottomUnion ¶
type PDFNewParamsPDFOptionsMarginBottomUnion interface {
ImplementsPDFNewParamsPDFOptionsMarginBottomUnion()
}
Satisfied by shared.UnionString, shared.UnionFloat.
type PDFNewParamsPDFOptionsMarginLeftUnion ¶
type PDFNewParamsPDFOptionsMarginLeftUnion interface {
ImplementsPDFNewParamsPDFOptionsMarginLeftUnion()
}
Satisfied by shared.UnionString, shared.UnionFloat.
type PDFNewParamsPDFOptionsMarginRightUnion ¶
type PDFNewParamsPDFOptionsMarginRightUnion interface {
ImplementsPDFNewParamsPDFOptionsMarginRightUnion()
}
Satisfied by shared.UnionString, shared.UnionFloat.
type PDFNewParamsPDFOptionsMarginTopUnion ¶
type PDFNewParamsPDFOptionsMarginTopUnion interface {
ImplementsPDFNewParamsPDFOptionsMarginTopUnion()
}
Satisfied by shared.UnionString, shared.UnionFloat.
type PDFNewParamsPDFOptionsWidthUnion ¶
type PDFNewParamsPDFOptionsWidthUnion interface {
ImplementsPDFNewParamsPDFOptionsWidthUnion()
}
Sets the width of paper. Can be a number or string with unit.
Satisfied by shared.UnionString, shared.UnionFloat.
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 ResponseInfoSource ¶
type ResponseInfoSource = shared.ResponseInfoSource
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"` // The maximum duration allowed for the browser action to complete after the page // has loaded (such as taking screenshots, extracting content, or generating PDFs). // If this time limit is exceeded, the action stops and returns a timeout error. ActionTimeout param.Field[float64] `json:"actionTimeout"` // 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 { Results ScrapeNewResponseResults `json:"results,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 ScrapeNewResponseResults ¶
type ScrapeNewResponseResults struct { Attributes []ScrapeNewResponseResultsAttribute `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 scrapeNewResponseResultsJSON `json:"-"` }
func (*ScrapeNewResponseResults) UnmarshalJSON ¶
func (r *ScrapeNewResponseResults) UnmarshalJSON(data []byte) (err error)
type ScrapeNewResponseResultsAttribute ¶
type ScrapeNewResponseResultsAttribute struct { // Attribute name Name string `json:"name,required"` // Attribute value Value string `json:"value,required"` JSON scrapeNewResponseResultsAttributeJSON `json:"-"` }
func (*ScrapeNewResponseResultsAttribute) UnmarshalJSON ¶
func (r *ScrapeNewResponseResultsAttribute) 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"` // The maximum duration allowed for the browser action to complete after the page // has loaded (such as taking screenshots, extracting content, or generating PDFs). // If this time limit is exceeded, the action stops and returns a timeout error. ActionTimeout param.Field[float64] `json:"actionTimeout"` // 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"` // The maximum duration allowed for the browser action to complete after the page // has loaded (such as taking screenshots, extracting content, or generating PDFs). // If this time limit is exceeded, the action stops and returns a timeout error. ActionTimeout param.Field[float64] `json:"actionTimeout"` // 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 TokenPolicyResourcesIAMResourcesTypeObjectNested ¶
type TokenPolicyResourcesIAMResourcesTypeObjectNested = shared.TokenPolicyResourcesIAMResourcesTypeObjectNested
Map of nested resource permissions
This is an alias to an internal type.
type TokenPolicyResourcesIAMResourcesTypeObjectNestedParam ¶
type TokenPolicyResourcesIAMResourcesTypeObjectNestedParam = shared.TokenPolicyResourcesIAMResourcesTypeObjectNestedParam
Map of nested resource permissions
This is an alias to an internal type.
type TokenPolicyResourcesIAMResourcesTypeObjectString ¶
type TokenPolicyResourcesIAMResourcesTypeObjectString = shared.TokenPolicyResourcesIAMResourcesTypeObjectString
Map of simple string resource permissions
This is an alias to an internal type.
type TokenPolicyResourcesIAMResourcesTypeObjectStringParam ¶
type TokenPolicyResourcesIAMResourcesTypeObjectStringParam = shared.TokenPolicyResourcesIAMResourcesTypeObjectStringParam
Map of simple string resource permissions
This is an alias to an internal type.
type TokenPolicyResourcesUnion ¶
type TokenPolicyResourcesUnion = shared.TokenPolicyResourcesUnion
A list of resource names that the policy applies to.
This is an alias to an internal type.
type TokenPolicyResourcesUnionParam ¶
type TokenPolicyResourcesUnionParam = shared.TokenPolicyResourcesUnionParam
A list of resource names that the policy applies to.
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.