pagerules

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin

This is an alias to an internal value.

View Source
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare

This is an alias to an internal value.

View Source
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector

This is an alias to an internal value.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASN added in v2.1.0

type ASN = shared.ASN

This is an alias to an internal type.

type ASNParam added in v2.1.0

type ASNParam = shared.ASNParam

This is an alias to an internal type.

type AuditLog

type AuditLog = shared.AuditLog

This is an alias to an internal type.

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 CloudflareTunnel

type CloudflareTunnel = shared.CloudflareTunnel

A Cloudflare Tunnel that connects your origin to Cloudflare's edge.

This is an alias to an internal type.

type CloudflareTunnelConnection

type CloudflareTunnelConnection = shared.CloudflareTunnelConnection

This is an alias to an internal type.

type CloudflareTunnelTunType

type CloudflareTunnelTunType = shared.CloudflareTunnelTunType

The type of tunnel.

This is an alias to an internal type.

type Error

type Error = apierror.Error

type ErrorData

type ErrorData = shared.ErrorData

This is an alias to an internal type.

type Member added in v2.1.0

type Member = shared.Member

This is an alias to an internal type.

type MemberParam added in v2.1.0

type MemberParam = shared.MemberParam

This is an alias to an internal type.

type MemberRole added in v2.1.0

type MemberRole = shared.MemberRole

This is an alias to an internal type.

type MemberRoleParam added in v2.1.0

type MemberRoleParam = shared.MemberRoleParam

This is an alias to an internal type.

type MemberRolesPermissions added in v2.1.0

type MemberRolesPermissions = shared.MemberRolesPermissions

This is an alias to an internal type.

type MemberRolesPermissionsParam added in v2.1.0

type MemberRolesPermissionsParam = shared.MemberRolesPermissionsParam

This is an alias to an internal type.

type MemberUser added in v2.1.0

type MemberUser = shared.MemberUser

This is an alias to an internal type.

type MemberUserParam added in v2.1.0

type MemberUserParam = shared.MemberUserParam

This is an alias to an internal type.

type PageRule

type PageRule struct {
	// Identifier
	ID string `json:"id,required"`
	// The set of actions to perform if the targets of this rule match the request.
	// Actions can redirect to another URL or override settings, but not both.
	Actions []Route `json:"actions,required"`
	// The timestamp of when the Page Rule was created.
	CreatedOn time.Time `json:"created_on,required" format:"date-time"`
	// The timestamp of when the Page Rule was last modified.
	ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
	// The priority of the rule, used to define which Page Rule is processed over
	// another. A higher number indicates a higher priority. For example, if you have a
	// catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to
	// take precedence (rule B: `/images/special/*`), specify a higher priority for
	// rule B so it overrides rule A.
	Priority int64 `json:"priority,required"`
	// The status of the Page Rule.
	Status PageRuleStatus `json:"status,required"`
	// The rule targets to evaluate on each request.
	Targets []Target     `json:"targets,required"`
	JSON    pageRuleJSON `json:"-"`
}

func (*PageRule) UnmarshalJSON

func (r *PageRule) UnmarshalJSON(data []byte) (err error)

type PageRuleStatus

type PageRuleStatus string

The status of the Page Rule.

const (
	PageRuleStatusActive   PageRuleStatus = "active"
	PageRuleStatusDisabled PageRuleStatus = "disabled"
)

func (PageRuleStatus) IsKnown

func (r PageRuleStatus) IsKnown() bool

type PageruleDeleteParams

type PageruleDeleteParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	Body   interface{}         `json:"body,required"`
}

func (PageruleDeleteParams) MarshalJSON

func (r PageruleDeleteParams) MarshalJSON() (data []byte, err error)

type PageruleDeleteResponse

type PageruleDeleteResponse struct {
	// Identifier
	ID   string                     `json:"id,required"`
	JSON pageruleDeleteResponseJSON `json:"-"`
}

func (*PageruleDeleteResponse) UnmarshalJSON

func (r *PageruleDeleteResponse) UnmarshalJSON(data []byte) (err error)

type PageruleDeleteResponseEnvelope

type PageruleDeleteResponseEnvelope struct {
	Errors   []shared.ResponseInfo  `json:"errors,required"`
	Messages []shared.ResponseInfo  `json:"messages,required"`
	Result   PageruleDeleteResponse `json:"result,required,nullable"`
	// Whether the API call was successful
	Success PageruleDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    pageruleDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*PageruleDeleteResponseEnvelope) UnmarshalJSON

func (r *PageruleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PageruleDeleteResponseEnvelopeSuccess

type PageruleDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PageruleDeleteResponseEnvelopeSuccessTrue PageruleDeleteResponseEnvelopeSuccess = true
)

func (PageruleDeleteResponseEnvelopeSuccess) IsKnown

type PageruleEditParams

type PageruleEditParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The set of actions to perform if the targets of this rule match the request.
	// Actions can redirect to another URL or override settings, but not both.
	Actions param.Field[[]RouteParam] `json:"actions"`
	// The priority of the rule, used to define which Page Rule is processed over
	// another. A higher number indicates a higher priority. For example, if you have a
	// catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to
	// take precedence (rule B: `/images/special/*`), specify a higher priority for
	// rule B so it overrides rule A.
	Priority param.Field[int64] `json:"priority"`
	// The status of the Page Rule.
	Status param.Field[PageruleEditParamsStatus] `json:"status"`
	// The rule targets to evaluate on each request.
	Targets param.Field[[]TargetParam] `json:"targets"`
}

func (PageruleEditParams) MarshalJSON

func (r PageruleEditParams) MarshalJSON() (data []byte, err error)

type PageruleEditParamsStatus

type PageruleEditParamsStatus string

The status of the Page Rule.

const (
	PageruleEditParamsStatusActive   PageruleEditParamsStatus = "active"
	PageruleEditParamsStatusDisabled PageruleEditParamsStatus = "disabled"
)

func (PageruleEditParamsStatus) IsKnown

func (r PageruleEditParamsStatus) IsKnown() bool

type PageruleEditResponseEnvelope

type PageruleEditResponseEnvelope struct {
	Errors   []shared.ResponseInfo     `json:"errors,required"`
	Messages []shared.ResponseInfo     `json:"messages,required"`
	Result   PageruleEditResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success PageruleEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    pageruleEditResponseEnvelopeJSON    `json:"-"`
}

func (*PageruleEditResponseEnvelope) UnmarshalJSON

func (r *PageruleEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PageruleEditResponseEnvelopeSuccess

type PageruleEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PageruleEditResponseEnvelopeSuccessTrue PageruleEditResponseEnvelopeSuccess = true
)

func (PageruleEditResponseEnvelopeSuccess) IsKnown

type PageruleEditResponseUnion

type PageruleEditResponseUnion interface {
	ImplementsPagerulesPageruleEditResponseUnion()
}

Union satisfied by pagerules.PageruleEditResponseUnknown or shared.UnionString.

type PageruleGetParams

type PageruleGetParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
}

type PageruleGetResponseEnvelope

type PageruleGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo    `json:"errors,required"`
	Messages []shared.ResponseInfo    `json:"messages,required"`
	Result   PageruleGetResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success PageruleGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    pageruleGetResponseEnvelopeJSON    `json:"-"`
}

func (*PageruleGetResponseEnvelope) UnmarshalJSON

func (r *PageruleGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PageruleGetResponseEnvelopeSuccess

type PageruleGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PageruleGetResponseEnvelopeSuccessTrue PageruleGetResponseEnvelopeSuccess = true
)

func (PageruleGetResponseEnvelopeSuccess) IsKnown

type PageruleGetResponseUnion

type PageruleGetResponseUnion interface {
	ImplementsPagerulesPageruleGetResponseUnion()
}

Union satisfied by pagerules.PageruleGetResponseUnknown or shared.UnionString.

type PageruleListParams

type PageruleListParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The direction used to sort returned Page Rules.
	Direction param.Field[PageruleListParamsDirection] `query:"direction"`
	// When set to `all`, all the search requirements must match. When set to `any`,
	// only one of the search requirements has to match.
	Match param.Field[PageruleListParamsMatch] `query:"match"`
	// The field used to sort returned Page Rules.
	Order param.Field[PageruleListParamsOrder] `query:"order"`
	// The status of the Page Rule.
	Status param.Field[PageruleListParamsStatus] `query:"status"`
}

func (PageruleListParams) URLQuery

func (r PageruleListParams) URLQuery() (v url.Values)

URLQuery serializes PageruleListParams's query parameters as `url.Values`.

type PageruleListParamsDirection

type PageruleListParamsDirection string

The direction used to sort returned Page Rules.

const (
	PageruleListParamsDirectionAsc  PageruleListParamsDirection = "asc"
	PageruleListParamsDirectionDesc PageruleListParamsDirection = "desc"
)

func (PageruleListParamsDirection) IsKnown

func (r PageruleListParamsDirection) IsKnown() bool

type PageruleListParamsMatch

type PageruleListParamsMatch string

When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.

const (
	PageruleListParamsMatchAny PageruleListParamsMatch = "any"
	PageruleListParamsMatchAll PageruleListParamsMatch = "all"
)

func (PageruleListParamsMatch) IsKnown

func (r PageruleListParamsMatch) IsKnown() bool

type PageruleListParamsOrder

type PageruleListParamsOrder string

The field used to sort returned Page Rules.

const (
	PageruleListParamsOrderStatus   PageruleListParamsOrder = "status"
	PageruleListParamsOrderPriority PageruleListParamsOrder = "priority"
)

func (PageruleListParamsOrder) IsKnown

func (r PageruleListParamsOrder) IsKnown() bool

type PageruleListParamsStatus

type PageruleListParamsStatus string

The status of the Page Rule.

const (
	PageruleListParamsStatusActive   PageruleListParamsStatus = "active"
	PageruleListParamsStatusDisabled PageruleListParamsStatus = "disabled"
)

func (PageruleListParamsStatus) IsKnown

func (r PageruleListParamsStatus) IsKnown() bool

type PageruleListResponseEnvelope

type PageruleListResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	Result   []PageRule            `json:"result,required"`
	// Whether the API call was successful
	Success PageruleListResponseEnvelopeSuccess `json:"success,required"`
	JSON    pageruleListResponseEnvelopeJSON    `json:"-"`
}

func (*PageruleListResponseEnvelope) UnmarshalJSON

func (r *PageruleListResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PageruleListResponseEnvelopeSuccess

type PageruleListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PageruleListResponseEnvelopeSuccessTrue PageruleListResponseEnvelopeSuccess = true
)

func (PageruleListResponseEnvelopeSuccess) IsKnown

type PageruleNewParams

type PageruleNewParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The set of actions to perform if the targets of this rule match the request.
	// Actions can redirect to another URL or override settings, but not both.
	Actions param.Field[[]RouteParam] `json:"actions,required"`
	// The rule targets to evaluate on each request.
	Targets param.Field[[]TargetParam] `json:"targets,required"`
	// The priority of the rule, used to define which Page Rule is processed over
	// another. A higher number indicates a higher priority. For example, if you have a
	// catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to
	// take precedence (rule B: `/images/special/*`), specify a higher priority for
	// rule B so it overrides rule A.
	Priority param.Field[int64] `json:"priority"`
	// The status of the Page Rule.
	Status param.Field[PageruleNewParamsStatus] `json:"status"`
}

func (PageruleNewParams) MarshalJSON

func (r PageruleNewParams) MarshalJSON() (data []byte, err error)

type PageruleNewParamsStatus

type PageruleNewParamsStatus string

The status of the Page Rule.

const (
	PageruleNewParamsStatusActive   PageruleNewParamsStatus = "active"
	PageruleNewParamsStatusDisabled PageruleNewParamsStatus = "disabled"
)

func (PageruleNewParamsStatus) IsKnown

func (r PageruleNewParamsStatus) IsKnown() bool

type PageruleNewResponseEnvelope

type PageruleNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo    `json:"errors,required"`
	Messages []shared.ResponseInfo    `json:"messages,required"`
	Result   PageruleNewResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success PageruleNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    pageruleNewResponseEnvelopeJSON    `json:"-"`
}

func (*PageruleNewResponseEnvelope) UnmarshalJSON

func (r *PageruleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PageruleNewResponseEnvelopeSuccess

type PageruleNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PageruleNewResponseEnvelopeSuccessTrue PageruleNewResponseEnvelopeSuccess = true
)

func (PageruleNewResponseEnvelopeSuccess) IsKnown

type PageruleNewResponseUnion

type PageruleNewResponseUnion interface {
	ImplementsPagerulesPageruleNewResponseUnion()
}

Union satisfied by pagerules.PageruleNewResponseUnknown or shared.UnionString.

type PageruleService

type PageruleService struct {
	Options  []option.RequestOption
	Settings *SettingService
}

PageruleService 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 NewPageruleService method instead.

func NewPageruleService

func NewPageruleService(opts ...option.RequestOption) (r *PageruleService)

NewPageruleService 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 (*PageruleService) Delete

func (r *PageruleService) Delete(ctx context.Context, pageruleID string, params PageruleDeleteParams, opts ...option.RequestOption) (res *PageruleDeleteResponse, err error)

Deletes an existing Page Rule.

func (*PageruleService) Edit

func (r *PageruleService) Edit(ctx context.Context, pageruleID string, params PageruleEditParams, opts ...option.RequestOption) (res *PageruleEditResponseUnion, err error)

Updates one or more fields of an existing Page Rule.

func (*PageruleService) Get

func (r *PageruleService) Get(ctx context.Context, pageruleID string, query PageruleGetParams, opts ...option.RequestOption) (res *PageruleGetResponseUnion, err error)

Fetches the details of a Page Rule.

func (*PageruleService) List

func (r *PageruleService) List(ctx context.Context, params PageruleListParams, opts ...option.RequestOption) (res *[]PageRule, err error)

Fetches Page Rules in a zone.

func (*PageruleService) New

Creates a new Page Rule.

func (*PageruleService) Update

func (r *PageruleService) Update(ctx context.Context, pageruleID string, params PageruleUpdateParams, opts ...option.RequestOption) (res *PageruleUpdateResponseUnion, err error)

Replaces the configuration of an existing Page Rule. The configuration of the updated Page Rule will exactly match the data passed in the API request.

type PageruleUpdateParams

type PageruleUpdateParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// The set of actions to perform if the targets of this rule match the request.
	// Actions can redirect to another URL or override settings, but not both.
	Actions param.Field[[]RouteParam] `json:"actions,required"`
	// The rule targets to evaluate on each request.
	Targets param.Field[[]TargetParam] `json:"targets,required"`
	// The priority of the rule, used to define which Page Rule is processed over
	// another. A higher number indicates a higher priority. For example, if you have a
	// catch-all Page Rule (rule A: `/images/*`) but want a more specific Page Rule to
	// take precedence (rule B: `/images/special/*`), specify a higher priority for
	// rule B so it overrides rule A.
	Priority param.Field[int64] `json:"priority"`
	// The status of the Page Rule.
	Status param.Field[PageruleUpdateParamsStatus] `json:"status"`
}

func (PageruleUpdateParams) MarshalJSON

func (r PageruleUpdateParams) MarshalJSON() (data []byte, err error)

type PageruleUpdateParamsStatus

type PageruleUpdateParamsStatus string

The status of the Page Rule.

const (
	PageruleUpdateParamsStatusActive   PageruleUpdateParamsStatus = "active"
	PageruleUpdateParamsStatusDisabled PageruleUpdateParamsStatus = "disabled"
)

func (PageruleUpdateParamsStatus) IsKnown

func (r PageruleUpdateParamsStatus) IsKnown() bool

type PageruleUpdateResponseEnvelope

type PageruleUpdateResponseEnvelope struct {
	Errors   []shared.ResponseInfo       `json:"errors,required"`
	Messages []shared.ResponseInfo       `json:"messages,required"`
	Result   PageruleUpdateResponseUnion `json:"result,required"`
	// Whether the API call was successful
	Success PageruleUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    pageruleUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*PageruleUpdateResponseEnvelope) UnmarshalJSON

func (r *PageruleUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type PageruleUpdateResponseEnvelopeSuccess

type PageruleUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	PageruleUpdateResponseEnvelopeSuccessTrue PageruleUpdateResponseEnvelopeSuccess = true
)

func (PageruleUpdateResponseEnvelopeSuccess) IsKnown

type PageruleUpdateResponseUnion

type PageruleUpdateResponseUnion interface {
	ImplementsPagerulesPageruleUpdateResponseUnion()
}

Union satisfied by pagerules.PageruleUpdateResponseUnknown or shared.UnionString.

type Permission

type Permission = shared.Permission

This is an alias to an internal type.

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 ResponseInfo

type ResponseInfo = shared.ResponseInfo

This is an alias to an internal type.

type Role

type Role = shared.Role

This is an alias to an internal type.

type Route

type Route struct {
	// The timestamp of when the override was last modified.
	ModifiedOn time.Time `json:"modified_on" format:"date-time"`
	// The type of route.
	Name  RouteName  `json:"name"`
	Value RouteValue `json:"value"`
	JSON  routeJSON  `json:"-"`
}

func (*Route) UnmarshalJSON

func (r *Route) UnmarshalJSON(data []byte) (err error)

type RouteName

type RouteName string

The type of route.

const (
	RouteNameForwardURL RouteName = "forward_url"
)

func (RouteName) IsKnown

func (r RouteName) IsKnown() bool

type RouteParam

type RouteParam struct {
	// The type of route.
	Name  param.Field[RouteName]       `json:"name"`
	Value param.Field[RouteValueParam] `json:"value"`
}

func (RouteParam) MarshalJSON

func (r RouteParam) MarshalJSON() (data []byte, err error)

type RouteValue

type RouteValue struct {
	// The response type for the URL redirect.
	Type RouteValueType `json:"type"`
	// The URL to redirect the request to. Notes: ${num} refers to the position of '\*'
	// in the constraint value.
	URL  string         `json:"url"`
	JSON routeValueJSON `json:"-"`
}

func (*RouteValue) UnmarshalJSON

func (r *RouteValue) UnmarshalJSON(data []byte) (err error)

type RouteValueParam

type RouteValueParam struct {
	// The response type for the URL redirect.
	Type param.Field[RouteValueType] `json:"type"`
	// The URL to redirect the request to. Notes: ${num} refers to the position of '\*'
	// in the constraint value.
	URL param.Field[string] `json:"url"`
}

func (RouteValueParam) MarshalJSON

func (r RouteValueParam) MarshalJSON() (data []byte, err error)

type RouteValueType

type RouteValueType string

The response type for the URL redirect.

const (
	RouteValueTypeTemporary RouteValueType = "temporary"
	RouteValueTypePermanent RouteValueType = "permanent"
)

func (RouteValueType) IsKnown

func (r RouteValueType) IsKnown() bool

type SettingListParams

type SettingListParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
}

type SettingListResponse

type SettingListResponse = interface{}

type SettingListResponseEnvelope

type SettingListResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Settings available for the zone.
	Result []SettingListResponse `json:"result,required"`
	// Whether the API call was successful
	Success SettingListResponseEnvelopeSuccess `json:"success,required"`
	JSON    settingListResponseEnvelopeJSON    `json:"-"`
}

func (*SettingListResponseEnvelope) UnmarshalJSON

func (r *SettingListResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type SettingListResponseEnvelopeSuccess

type SettingListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	SettingListResponseEnvelopeSuccessTrue SettingListResponseEnvelopeSuccess = true
)

func (SettingListResponseEnvelopeSuccess) IsKnown

type SettingService

type SettingService struct {
	Options []option.RequestOption
}

SettingService 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 NewSettingService method instead.

func NewSettingService

func NewSettingService(opts ...option.RequestOption) (r *SettingService)

NewSettingService 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 (*SettingService) List

func (r *SettingService) List(ctx context.Context, query SettingListParams, opts ...option.RequestOption) (res *[]SettingListResponse, err error)

Returns a list of settings (and their details) that Page Rules can apply to matching requests.

type Target

type Target struct {
	// String constraint.
	Constraint TargetConstraint `json:"constraint,required"`
	// A target based on the URL of the request.
	Target TargetTarget `json:"target,required"`
	JSON   targetJSON   `json:"-"`
}

A request condition target.

func (*Target) UnmarshalJSON

func (r *Target) UnmarshalJSON(data []byte) (err error)

type TargetConstraint

type TargetConstraint struct {
	// The matches operator can use asterisks and pipes as wildcard and 'or' operators.
	Operator TargetConstraintOperator `json:"operator,required"`
	// The URL pattern to match against the current request. The pattern may contain up
	// to four asterisks ('\*') as placeholders.
	Value string               `json:"value,required"`
	JSON  targetConstraintJSON `json:"-"`
}

String constraint.

func (*TargetConstraint) UnmarshalJSON

func (r *TargetConstraint) UnmarshalJSON(data []byte) (err error)

type TargetConstraintOperator

type TargetConstraintOperator string

The matches operator can use asterisks and pipes as wildcard and 'or' operators.

const (
	TargetConstraintOperatorMatches    TargetConstraintOperator = "matches"
	TargetConstraintOperatorContains   TargetConstraintOperator = "contains"
	TargetConstraintOperatorEquals     TargetConstraintOperator = "equals"
	TargetConstraintOperatorNotEqual   TargetConstraintOperator = "not_equal"
	TargetConstraintOperatorNotContain TargetConstraintOperator = "not_contain"
)

func (TargetConstraintOperator) IsKnown

func (r TargetConstraintOperator) IsKnown() bool

type TargetConstraintParam

type TargetConstraintParam struct {
	// The matches operator can use asterisks and pipes as wildcard and 'or' operators.
	Operator param.Field[TargetConstraintOperator] `json:"operator,required"`
	// The URL pattern to match against the current request. The pattern may contain up
	// to four asterisks ('\*') as placeholders.
	Value param.Field[string] `json:"value,required"`
}

String constraint.

func (TargetConstraintParam) MarshalJSON

func (r TargetConstraintParam) MarshalJSON() (data []byte, err error)

type TargetParam

type TargetParam struct {
	// String constraint.
	Constraint param.Field[TargetConstraintParam] `json:"constraint,required"`
	// A target based on the URL of the request.
	Target param.Field[TargetTarget] `json:"target,required"`
}

A request condition target.

func (TargetParam) MarshalJSON

func (r TargetParam) MarshalJSON() (data []byte, err error)

type TargetTarget

type TargetTarget string

A target based on the URL of the request.

const (
	TargetTargetURL TargetTarget = "url"
)

func (TargetTarget) IsKnown

func (r TargetTarget) IsKnown() bool

Jump to

Keyboard shortcuts

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