cache

package
v2.0.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachePurgeParams

type CachePurgeParams struct {
	ZoneID          param.Field[string]                 `path:"zone_id,required"`
	Files           param.Field[[]CachePurgeParamsFile] `json:"files"`
	Hosts           param.Field[[]string]               `json:"hosts"`
	Prefixes        param.Field[[]string]               `json:"prefixes"`
	PurgeEverything param.Field[bool]                   `json:"purge_everything"`
	Tags            param.Field[[]string]               `json:"tags"`
}

func (CachePurgeParams) MarshalJSON

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

type CachePurgeParamsFile

type CachePurgeParamsFile interface {
	ImplementsCacheCachePurgeParamsFile()
}

Satisfied by shared.UnionString, cache.CachePurgeParamsFilesCachePurgeURLAndHeaders.

type CachePurgeParamsFilesCachePurgeURLAndHeaders

type CachePurgeParamsFilesCachePurgeURLAndHeaders struct {
	Headers param.Field[interface{}] `json:"headers"`
	URL     param.Field[string]      `json:"url"`
}

func (CachePurgeParamsFilesCachePurgeURLAndHeaders) ImplementsCacheCachePurgeParamsFile

func (r CachePurgeParamsFilesCachePurgeURLAndHeaders) ImplementsCacheCachePurgeParamsFile()

func (CachePurgeParamsFilesCachePurgeURLAndHeaders) MarshalJSON

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

type CachePurgeResponse

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

func (*CachePurgeResponse) UnmarshalJSON

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

type CachePurgeResponseEnvelope

type CachePurgeResponseEnvelope struct {
	Errors   []CachePurgeResponseEnvelopeErrors   `json:"errors,required"`
	Messages []CachePurgeResponseEnvelopeMessages `json:"messages,required"`
	Result   CachePurgeResponse                   `json:"result,required,nullable"`
	// Whether the API call was successful
	Success CachePurgeResponseEnvelopeSuccess `json:"success,required"`
	JSON    cachePurgeResponseEnvelopeJSON    `json:"-"`
}

func (*CachePurgeResponseEnvelope) UnmarshalJSON

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

type CachePurgeResponseEnvelopeErrors

type CachePurgeResponseEnvelopeErrors struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    cachePurgeResponseEnvelopeErrorsJSON `json:"-"`
}

func (*CachePurgeResponseEnvelopeErrors) UnmarshalJSON

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

type CachePurgeResponseEnvelopeMessages

type CachePurgeResponseEnvelopeMessages struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    cachePurgeResponseEnvelopeMessagesJSON `json:"-"`
}

func (*CachePurgeResponseEnvelopeMessages) UnmarshalJSON

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

type CachePurgeResponseEnvelopeSuccess

type CachePurgeResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	CachePurgeResponseEnvelopeSuccessTrue CachePurgeResponseEnvelopeSuccess = true
)

type CacheReserveClearParams

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

type CacheReserveClearResponse

type CacheReserveClearResponse struct {
	// ID of the zone setting.
	ID CacheReserveClearResponseID `json:"id,required"`
	// last time this setting was modified.
	ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
	// The time that the latest Cache Reserve Clear operation started.
	StartTs time.Time `json:"start_ts,required" format:"date-time"`
	// The current state of the Cache Reserve Clear operation.
	State CacheReserveClearResponseState `json:"state,required"`
	// The time that the latest Cache Reserve Clear operation completed.
	EndTs time.Time                     `json:"end_ts" format:"date-time"`
	JSON  cacheReserveClearResponseJSON `json:"-"`
}

You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.

func (*CacheReserveClearResponse) UnmarshalJSON

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

type CacheReserveClearResponseEnvelope

type CacheReserveClearResponseEnvelope struct {
	Errors   []CacheReserveClearResponseEnvelopeErrors   `json:"errors,required"`
	Messages []CacheReserveClearResponseEnvelopeMessages `json:"messages,required"`
	// You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
	// disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
	// You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
	// that you cannot undo or cancel this operation.
	Result CacheReserveClearResponse `json:"result,required"`
	// Whether the API call was successful
	Success CacheReserveClearResponseEnvelopeSuccess `json:"success,required"`
	JSON    cacheReserveClearResponseEnvelopeJSON    `json:"-"`
}

func (*CacheReserveClearResponseEnvelope) UnmarshalJSON

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

type CacheReserveClearResponseEnvelopeErrors

type CacheReserveClearResponseEnvelopeErrors struct {
	Code    int64                                       `json:"code,required"`
	Message string                                      `json:"message,required"`
	JSON    cacheReserveClearResponseEnvelopeErrorsJSON `json:"-"`
}

func (*CacheReserveClearResponseEnvelopeErrors) UnmarshalJSON

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

type CacheReserveClearResponseEnvelopeMessages

type CacheReserveClearResponseEnvelopeMessages struct {
	Code    int64                                         `json:"code,required"`
	Message string                                        `json:"message,required"`
	JSON    cacheReserveClearResponseEnvelopeMessagesJSON `json:"-"`
}

func (*CacheReserveClearResponseEnvelopeMessages) UnmarshalJSON

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

type CacheReserveClearResponseEnvelopeSuccess

type CacheReserveClearResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	CacheReserveClearResponseEnvelopeSuccessTrue CacheReserveClearResponseEnvelopeSuccess = true
)

type CacheReserveClearResponseID

type CacheReserveClearResponseID string

ID of the zone setting.

const (
	CacheReserveClearResponseIDCacheReserveClear CacheReserveClearResponseID = "cache_reserve_clear"
)

type CacheReserveClearResponseState

type CacheReserveClearResponseState string

The current state of the Cache Reserve Clear operation.

const (
	CacheReserveClearResponseStateInProgress CacheReserveClearResponseState = "In-progress"
	CacheReserveClearResponseStateCompleted  CacheReserveClearResponseState = "Completed"
)

type CacheReserveEditParams

type CacheReserveEditParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// Value of the Cache Reserve zone setting.
	Value param.Field[CacheReserveEditParamsValue] `json:"value,required"`
}

func (CacheReserveEditParams) MarshalJSON

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

type CacheReserveEditParamsValue

type CacheReserveEditParamsValue string

Value of the Cache Reserve zone setting.

const (
	CacheReserveEditParamsValueOn  CacheReserveEditParamsValue = "on"
	CacheReserveEditParamsValueOff CacheReserveEditParamsValue = "off"
)

type CacheReserveEditResponse

type CacheReserveEditResponse struct {
	// ID of the zone setting.
	ID CacheReserveEditResponseID `json:"id,required"`
	// last time this setting was modified.
	ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
	// Value of the Cache Reserve zone setting.
	Value CacheReserveEditResponseValue `json:"value,required"`
	JSON  cacheReserveEditResponseJSON  `json:"-"`
}

Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information.

func (*CacheReserveEditResponse) UnmarshalJSON

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

type CacheReserveEditResponseEnvelope

type CacheReserveEditResponseEnvelope struct {
	Errors   []CacheReserveEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []CacheReserveEditResponseEnvelopeMessages `json:"messages,required"`
	// Increase cache lifetimes by automatically storing all cacheable files into
	// Cloudflare's persistent object storage buckets. Requires Cache Reserve
	// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
	// to reduce Reserve operations costs. See the
	// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
	// for more information.
	Result CacheReserveEditResponse `json:"result,required"`
	// Whether the API call was successful
	Success CacheReserveEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    cacheReserveEditResponseEnvelopeJSON    `json:"-"`
}

func (*CacheReserveEditResponseEnvelope) UnmarshalJSON

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

type CacheReserveEditResponseEnvelopeErrors

type CacheReserveEditResponseEnvelopeErrors struct {
	Code    int64                                      `json:"code,required"`
	Message string                                     `json:"message,required"`
	JSON    cacheReserveEditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*CacheReserveEditResponseEnvelopeErrors) UnmarshalJSON

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

type CacheReserveEditResponseEnvelopeMessages

type CacheReserveEditResponseEnvelopeMessages struct {
	Code    int64                                        `json:"code,required"`
	Message string                                       `json:"message,required"`
	JSON    cacheReserveEditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*CacheReserveEditResponseEnvelopeMessages) UnmarshalJSON

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

type CacheReserveEditResponseEnvelopeSuccess

type CacheReserveEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	CacheReserveEditResponseEnvelopeSuccessTrue CacheReserveEditResponseEnvelopeSuccess = true
)

type CacheReserveEditResponseID

type CacheReserveEditResponseID string

ID of the zone setting.

const (
	CacheReserveEditResponseIDCacheReserve CacheReserveEditResponseID = "cache_reserve"
)

type CacheReserveEditResponseValue

type CacheReserveEditResponseValue string

Value of the Cache Reserve zone setting.

const (
	CacheReserveEditResponseValueOn  CacheReserveEditResponseValue = "on"
	CacheReserveEditResponseValueOff CacheReserveEditResponseValue = "off"
)

type CacheReserveGetParams

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

type CacheReserveGetResponse

type CacheReserveGetResponse struct {
	// ID of the zone setting.
	ID CacheReserveGetResponseID `json:"id,required"`
	// last time this setting was modified.
	ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
	// Value of the Cache Reserve zone setting.
	Value CacheReserveGetResponseValue `json:"value,required"`
	JSON  cacheReserveGetResponseJSON  `json:"-"`
}

Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information.

func (*CacheReserveGetResponse) UnmarshalJSON

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

type CacheReserveGetResponseEnvelope

type CacheReserveGetResponseEnvelope struct {
	Errors   []CacheReserveGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []CacheReserveGetResponseEnvelopeMessages `json:"messages,required"`
	// Increase cache lifetimes by automatically storing all cacheable files into
	// Cloudflare's persistent object storage buckets. Requires Cache Reserve
	// subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
	// to reduce Reserve operations costs. See the
	// [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
	// for more information.
	Result CacheReserveGetResponse `json:"result,required"`
	// Whether the API call was successful
	Success CacheReserveGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    cacheReserveGetResponseEnvelopeJSON    `json:"-"`
}

func (*CacheReserveGetResponseEnvelope) UnmarshalJSON

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

type CacheReserveGetResponseEnvelopeErrors

type CacheReserveGetResponseEnvelopeErrors struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    cacheReserveGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*CacheReserveGetResponseEnvelopeErrors) UnmarshalJSON

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

type CacheReserveGetResponseEnvelopeMessages

type CacheReserveGetResponseEnvelopeMessages struct {
	Code    int64                                       `json:"code,required"`
	Message string                                      `json:"message,required"`
	JSON    cacheReserveGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*CacheReserveGetResponseEnvelopeMessages) UnmarshalJSON

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

type CacheReserveGetResponseEnvelopeSuccess

type CacheReserveGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	CacheReserveGetResponseEnvelopeSuccessTrue CacheReserveGetResponseEnvelopeSuccess = true
)

type CacheReserveGetResponseID

type CacheReserveGetResponseID string

ID of the zone setting.

const (
	CacheReserveGetResponseIDCacheReserve CacheReserveGetResponseID = "cache_reserve"
)

type CacheReserveGetResponseValue

type CacheReserveGetResponseValue string

Value of the Cache Reserve zone setting.

const (
	CacheReserveGetResponseValueOn  CacheReserveGetResponseValue = "on"
	CacheReserveGetResponseValueOff CacheReserveGetResponseValue = "off"
)

type CacheReserveService

type CacheReserveService struct {
	Options []option.RequestOption
}

CacheReserveService 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 NewCacheReserveService method instead.

func NewCacheReserveService

func NewCacheReserveService(opts ...option.RequestOption) (r *CacheReserveService)

NewCacheReserveService 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 (*CacheReserveService) Clear

You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.

func (*CacheReserveService) Edit

Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information.

func (*CacheReserveService) Get

Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information.

func (*CacheReserveService) Status

You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.

type CacheReserveStatusParams

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

type CacheReserveStatusResponse

type CacheReserveStatusResponse struct {
	// ID of the zone setting.
	ID CacheReserveStatusResponseID `json:"id,required"`
	// last time this setting was modified.
	ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
	// The time that the latest Cache Reserve Clear operation started.
	StartTs time.Time `json:"start_ts,required" format:"date-time"`
	// The current state of the Cache Reserve Clear operation.
	State CacheReserveStatusResponseState `json:"state,required"`
	// The time that the latest Cache Reserve Clear operation completed.
	EndTs time.Time                      `json:"end_ts" format:"date-time"`
	JSON  cacheReserveStatusResponseJSON `json:"-"`
}

You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.

func (*CacheReserveStatusResponse) UnmarshalJSON

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

type CacheReserveStatusResponseEnvelope

type CacheReserveStatusResponseEnvelope struct {
	Errors   []CacheReserveStatusResponseEnvelopeErrors   `json:"errors,required"`
	Messages []CacheReserveStatusResponseEnvelopeMessages `json:"messages,required"`
	// You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
	// disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
	// You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind
	// that you cannot undo or cancel this operation.
	Result CacheReserveStatusResponse `json:"result,required"`
	// Whether the API call was successful
	Success CacheReserveStatusResponseEnvelopeSuccess `json:"success,required"`
	JSON    cacheReserveStatusResponseEnvelopeJSON    `json:"-"`
}

func (*CacheReserveStatusResponseEnvelope) UnmarshalJSON

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

type CacheReserveStatusResponseEnvelopeErrors

type CacheReserveStatusResponseEnvelopeErrors struct {
	Code    int64                                        `json:"code,required"`
	Message string                                       `json:"message,required"`
	JSON    cacheReserveStatusResponseEnvelopeErrorsJSON `json:"-"`
}

func (*CacheReserveStatusResponseEnvelopeErrors) UnmarshalJSON

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

type CacheReserveStatusResponseEnvelopeMessages

type CacheReserveStatusResponseEnvelopeMessages struct {
	Code    int64                                          `json:"code,required"`
	Message string                                         `json:"message,required"`
	JSON    cacheReserveStatusResponseEnvelopeMessagesJSON `json:"-"`
}

func (*CacheReserveStatusResponseEnvelopeMessages) UnmarshalJSON

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

type CacheReserveStatusResponseEnvelopeSuccess

type CacheReserveStatusResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	CacheReserveStatusResponseEnvelopeSuccessTrue CacheReserveStatusResponseEnvelopeSuccess = true
)

type CacheReserveStatusResponseID

type CacheReserveStatusResponseID string

ID of the zone setting.

const (
	CacheReserveStatusResponseIDCacheReserveClear CacheReserveStatusResponseID = "cache_reserve_clear"
)

type CacheReserveStatusResponseState

type CacheReserveStatusResponseState string

The current state of the Cache Reserve Clear operation.

const (
	CacheReserveStatusResponseStateInProgress CacheReserveStatusResponseState = "In-progress"
	CacheReserveStatusResponseStateCompleted  CacheReserveStatusResponseState = "Completed"
)

type CacheService

type CacheService struct {
	Options             []option.RequestOption
	CacheReserve        *CacheReserveService
	SmartTieredCache    *SmartTieredCacheService
	Variants            *VariantService
	RegionalTieredCache *RegionalTieredCacheService
}

CacheService 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 NewCacheService method instead.

func NewCacheService

func NewCacheService(opts ...option.RequestOption) (r *CacheService)

NewCacheService 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 (*CacheService) Purge

func (r *CacheService) Purge(ctx context.Context, params CachePurgeParams, opts ...option.RequestOption) (res *CachePurgeResponse, err error)

### Purge All Cached Content

Removes ALL files from Cloudflare's cache. All tiers can purge everything.

### Purge Cached Content by URL

Granularly removes one or more files from Cloudflare's cache by specifying URLs. All tiers can purge by URL.

To purge files with custom cache keys, include the headers used to compute the cache key as in the example. If you have a device type or geo in your cache key, you will need to include the CF-Device-Type or CF-IPCountry headers. If you have lang in your cache key, you will need to include the Accept-Language header.

**NB:** When including the Origin header, be sure to include the **scheme** and **hostname**. The port number can be omitted if it is the default port (80 for http, 443 for https), but must be included otherwise.

### Purge Cached Content by Tag, Host or Prefix

Granularly removes one or more files from Cloudflare's cache either by specifying the host, the associated Cache-Tag, or a Prefix. Only Enterprise customers are permitted to purge by Tag, Host or Prefix.

**NB:** Cache-Tag, host, and prefix purging each have a rate limit of 30,000 purge API calls in every 24 hour period. You may purge up to 30 tags, hosts, or prefixes in one API call. This rate limit can be raised for customers who need to purge at higher volume.

type CacheVariants

type CacheVariants struct {
	// ID of the zone setting.
	ID CacheVariantsID `json:"id,required"`
	// last time this setting was modified.
	ModifiedOn time.Time         `json:"modified_on,required,nullable" format:"date-time"`
	JSON       cacheVariantsJSON `json:"-"`
}

Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.

func (*CacheVariants) UnmarshalJSON

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

type CacheVariantsID

type CacheVariantsID string

ID of the zone setting.

const (
	CacheVariantsIDVariants CacheVariantsID = "variants"
)

type Error

type Error = apierror.Error

type RegionalTieredCacheEditParams

type RegionalTieredCacheEditParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// Value of the Regional Tiered Cache zone setting.
	Value param.Field[RegionalTieredCacheEditParamsValue] `json:"value,required"`
}

func (RegionalTieredCacheEditParams) MarshalJSON

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

type RegionalTieredCacheEditParamsValue

type RegionalTieredCacheEditParamsValue string

Value of the Regional Tiered Cache zone setting.

const (
	RegionalTieredCacheEditParamsValueOn  RegionalTieredCacheEditParamsValue = "on"
	RegionalTieredCacheEditParamsValueOff RegionalTieredCacheEditParamsValue = "off"
)

type RegionalTieredCacheEditResponse

type RegionalTieredCacheEditResponse struct {
	// ID of the zone setting.
	ID RegionalTieredCacheEditResponseID `json:"id,required"`
	// last time this setting was modified.
	ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
	// Instructs Cloudflare to check a regional hub data center on the way to your
	// upper tier. This can help improve performance for smart and custom tiered cache
	// topologies.
	Value RegionalTieredCacheEditResponseValue `json:"value,required"`
	JSON  regionalTieredCacheEditResponseJSON  `json:"-"`
}

Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.

func (*RegionalTieredCacheEditResponse) UnmarshalJSON

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

type RegionalTieredCacheEditResponseEnvelope

type RegionalTieredCacheEditResponseEnvelope struct {
	Errors   []RegionalTieredCacheEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []RegionalTieredCacheEditResponseEnvelopeMessages `json:"messages,required"`
	// Instructs Cloudflare to check a regional hub data center on the way to your
	// upper tier. This can help improve performance for smart and custom tiered cache
	// topologies.
	Result RegionalTieredCacheEditResponse `json:"result,required"`
	// Whether the API call was successful
	Success RegionalTieredCacheEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    regionalTieredCacheEditResponseEnvelopeJSON    `json:"-"`
}

func (*RegionalTieredCacheEditResponseEnvelope) UnmarshalJSON

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

type RegionalTieredCacheEditResponseEnvelopeErrors

type RegionalTieredCacheEditResponseEnvelopeErrors struct {
	Code    int64                                             `json:"code,required"`
	Message string                                            `json:"message,required"`
	JSON    regionalTieredCacheEditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*RegionalTieredCacheEditResponseEnvelopeErrors) UnmarshalJSON

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

type RegionalTieredCacheEditResponseEnvelopeMessages

type RegionalTieredCacheEditResponseEnvelopeMessages struct {
	Code    int64                                               `json:"code,required"`
	Message string                                              `json:"message,required"`
	JSON    regionalTieredCacheEditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*RegionalTieredCacheEditResponseEnvelopeMessages) UnmarshalJSON

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

type RegionalTieredCacheEditResponseEnvelopeSuccess

type RegionalTieredCacheEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	RegionalTieredCacheEditResponseEnvelopeSuccessTrue RegionalTieredCacheEditResponseEnvelopeSuccess = true
)

type RegionalTieredCacheEditResponseID

type RegionalTieredCacheEditResponseID string

ID of the zone setting.

const (
	RegionalTieredCacheEditResponseIDTcRegional RegionalTieredCacheEditResponseID = "tc_regional"
)

type RegionalTieredCacheEditResponseValue

type RegionalTieredCacheEditResponseValue struct {
	// ID of the zone setting.
	ID RegionalTieredCacheEditResponseValueID `json:"id,required"`
	// last time this setting was modified.
	ModifiedOn time.Time                                `json:"modified_on,required,nullable" format:"date-time"`
	JSON       regionalTieredCacheEditResponseValueJSON `json:"-"`
}

Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.

func (*RegionalTieredCacheEditResponseValue) UnmarshalJSON

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

type RegionalTieredCacheEditResponseValueID

type RegionalTieredCacheEditResponseValueID string

ID of the zone setting.

const (
	RegionalTieredCacheEditResponseValueIDTcRegional RegionalTieredCacheEditResponseValueID = "tc_regional"
)

type RegionalTieredCacheGetParams

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

type RegionalTieredCacheGetResponse

type RegionalTieredCacheGetResponse struct {
	// ID of the zone setting.
	ID RegionalTieredCacheGetResponseID `json:"id,required"`
	// last time this setting was modified.
	ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
	// Instructs Cloudflare to check a regional hub data center on the way to your
	// upper tier. This can help improve performance for smart and custom tiered cache
	// topologies.
	Value RegionalTieredCacheGetResponseValue `json:"value,required"`
	JSON  regionalTieredCacheGetResponseJSON  `json:"-"`
}

Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.

func (*RegionalTieredCacheGetResponse) UnmarshalJSON

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

type RegionalTieredCacheGetResponseEnvelope

type RegionalTieredCacheGetResponseEnvelope struct {
	Errors   []RegionalTieredCacheGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []RegionalTieredCacheGetResponseEnvelopeMessages `json:"messages,required"`
	// Instructs Cloudflare to check a regional hub data center on the way to your
	// upper tier. This can help improve performance for smart and custom tiered cache
	// topologies.
	Result RegionalTieredCacheGetResponse `json:"result,required"`
	// Whether the API call was successful
	Success RegionalTieredCacheGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    regionalTieredCacheGetResponseEnvelopeJSON    `json:"-"`
}

func (*RegionalTieredCacheGetResponseEnvelope) UnmarshalJSON

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

type RegionalTieredCacheGetResponseEnvelopeErrors

type RegionalTieredCacheGetResponseEnvelopeErrors struct {
	Code    int64                                            `json:"code,required"`
	Message string                                           `json:"message,required"`
	JSON    regionalTieredCacheGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*RegionalTieredCacheGetResponseEnvelopeErrors) UnmarshalJSON

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

type RegionalTieredCacheGetResponseEnvelopeMessages

type RegionalTieredCacheGetResponseEnvelopeMessages struct {
	Code    int64                                              `json:"code,required"`
	Message string                                             `json:"message,required"`
	JSON    regionalTieredCacheGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*RegionalTieredCacheGetResponseEnvelopeMessages) UnmarshalJSON

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

type RegionalTieredCacheGetResponseEnvelopeSuccess

type RegionalTieredCacheGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	RegionalTieredCacheGetResponseEnvelopeSuccessTrue RegionalTieredCacheGetResponseEnvelopeSuccess = true
)

type RegionalTieredCacheGetResponseID

type RegionalTieredCacheGetResponseID string

ID of the zone setting.

const (
	RegionalTieredCacheGetResponseIDTcRegional RegionalTieredCacheGetResponseID = "tc_regional"
)

type RegionalTieredCacheGetResponseValue

type RegionalTieredCacheGetResponseValue struct {
	// ID of the zone setting.
	ID RegionalTieredCacheGetResponseValueID `json:"id,required"`
	// last time this setting was modified.
	ModifiedOn time.Time                               `json:"modified_on,required,nullable" format:"date-time"`
	JSON       regionalTieredCacheGetResponseValueJSON `json:"-"`
}

Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.

func (*RegionalTieredCacheGetResponseValue) UnmarshalJSON

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

type RegionalTieredCacheGetResponseValueID

type RegionalTieredCacheGetResponseValueID string

ID of the zone setting.

const (
	RegionalTieredCacheGetResponseValueIDTcRegional RegionalTieredCacheGetResponseValueID = "tc_regional"
)

type RegionalTieredCacheService

type RegionalTieredCacheService struct {
	Options []option.RequestOption
}

RegionalTieredCacheService 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 NewRegionalTieredCacheService method instead.

func NewRegionalTieredCacheService

func NewRegionalTieredCacheService(opts ...option.RequestOption) (r *RegionalTieredCacheService)

NewRegionalTieredCacheService 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 (*RegionalTieredCacheService) Edit

Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.

func (*RegionalTieredCacheService) Get

Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.

type SmartTieredCacheDeleteParams

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

type SmartTieredCacheDeleteResponse added in v2.3.0

type SmartTieredCacheDeleteResponse interface {
	ImplementsCacheSmartTieredCacheDeleteResponse()
}

Union satisfied by cache.SmartTieredCacheDeleteResponseUnknown or shared.UnionString.

type SmartTieredCacheDeleteResponseEnvelope

type SmartTieredCacheDeleteResponseEnvelope struct {
	Errors   []SmartTieredCacheDeleteResponseEnvelopeErrors   `json:"errors,required"`
	Messages []SmartTieredCacheDeleteResponseEnvelopeMessages `json:"messages,required"`
	Result   SmartTieredCacheDeleteResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success SmartTieredCacheDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    smartTieredCacheDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*SmartTieredCacheDeleteResponseEnvelope) UnmarshalJSON

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

type SmartTieredCacheDeleteResponseEnvelopeErrors

type SmartTieredCacheDeleteResponseEnvelopeErrors struct {
	Code    int64                                            `json:"code,required"`
	Message string                                           `json:"message,required"`
	JSON    smartTieredCacheDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*SmartTieredCacheDeleteResponseEnvelopeErrors) UnmarshalJSON

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

type SmartTieredCacheDeleteResponseEnvelopeMessages

type SmartTieredCacheDeleteResponseEnvelopeMessages struct {
	Code    int64                                              `json:"code,required"`
	Message string                                             `json:"message,required"`
	JSON    smartTieredCacheDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*SmartTieredCacheDeleteResponseEnvelopeMessages) UnmarshalJSON

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

type SmartTieredCacheDeleteResponseEnvelopeSuccess

type SmartTieredCacheDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	SmartTieredCacheDeleteResponseEnvelopeSuccessTrue SmartTieredCacheDeleteResponseEnvelopeSuccess = true
)

type SmartTieredCacheEditParams

type SmartTieredCacheEditParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// Enables Tiered Cache.
	Value param.Field[SmartTieredCacheEditParamsValue] `json:"value,required"`
}

func (SmartTieredCacheEditParams) MarshalJSON

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

type SmartTieredCacheEditParamsValue

type SmartTieredCacheEditParamsValue string

Enables Tiered Cache.

const (
	SmartTieredCacheEditParamsValueOn  SmartTieredCacheEditParamsValue = "on"
	SmartTieredCacheEditParamsValueOff SmartTieredCacheEditParamsValue = "off"
)

type SmartTieredCacheEditResponse added in v2.3.0

type SmartTieredCacheEditResponse interface {
	ImplementsCacheSmartTieredCacheEditResponse()
}

Union satisfied by cache.SmartTieredCacheEditResponseUnknown or shared.UnionString.

type SmartTieredCacheEditResponseEnvelope

type SmartTieredCacheEditResponseEnvelope struct {
	Errors   []SmartTieredCacheEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []SmartTieredCacheEditResponseEnvelopeMessages `json:"messages,required"`
	Result   SmartTieredCacheEditResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success SmartTieredCacheEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    smartTieredCacheEditResponseEnvelopeJSON    `json:"-"`
}

func (*SmartTieredCacheEditResponseEnvelope) UnmarshalJSON

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

type SmartTieredCacheEditResponseEnvelopeErrors

type SmartTieredCacheEditResponseEnvelopeErrors struct {
	Code    int64                                          `json:"code,required"`
	Message string                                         `json:"message,required"`
	JSON    smartTieredCacheEditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*SmartTieredCacheEditResponseEnvelopeErrors) UnmarshalJSON

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

type SmartTieredCacheEditResponseEnvelopeMessages

type SmartTieredCacheEditResponseEnvelopeMessages struct {
	Code    int64                                            `json:"code,required"`
	Message string                                           `json:"message,required"`
	JSON    smartTieredCacheEditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*SmartTieredCacheEditResponseEnvelopeMessages) UnmarshalJSON

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

type SmartTieredCacheEditResponseEnvelopeSuccess

type SmartTieredCacheEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	SmartTieredCacheEditResponseEnvelopeSuccessTrue SmartTieredCacheEditResponseEnvelopeSuccess = true
)

type SmartTieredCacheGetParams

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

type SmartTieredCacheGetResponse added in v2.3.0

type SmartTieredCacheGetResponse interface {
	ImplementsCacheSmartTieredCacheGetResponse()
}

Union satisfied by cache.SmartTieredCacheGetResponseUnknown or shared.UnionString.

type SmartTieredCacheGetResponseEnvelope

type SmartTieredCacheGetResponseEnvelope struct {
	Errors   []SmartTieredCacheGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []SmartTieredCacheGetResponseEnvelopeMessages `json:"messages,required"`
	Result   SmartTieredCacheGetResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success SmartTieredCacheGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    smartTieredCacheGetResponseEnvelopeJSON    `json:"-"`
}

func (*SmartTieredCacheGetResponseEnvelope) UnmarshalJSON

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

type SmartTieredCacheGetResponseEnvelopeErrors

type SmartTieredCacheGetResponseEnvelopeErrors struct {
	Code    int64                                         `json:"code,required"`
	Message string                                        `json:"message,required"`
	JSON    smartTieredCacheGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*SmartTieredCacheGetResponseEnvelopeErrors) UnmarshalJSON

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

type SmartTieredCacheGetResponseEnvelopeMessages

type SmartTieredCacheGetResponseEnvelopeMessages struct {
	Code    int64                                           `json:"code,required"`
	Message string                                          `json:"message,required"`
	JSON    smartTieredCacheGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*SmartTieredCacheGetResponseEnvelopeMessages) UnmarshalJSON

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

type SmartTieredCacheGetResponseEnvelopeSuccess

type SmartTieredCacheGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	SmartTieredCacheGetResponseEnvelopeSuccessTrue SmartTieredCacheGetResponseEnvelopeSuccess = true
)

type SmartTieredCacheService

type SmartTieredCacheService struct {
	Options []option.RequestOption
}

SmartTieredCacheService 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 NewSmartTieredCacheService method instead.

func NewSmartTieredCacheService

func NewSmartTieredCacheService(opts ...option.RequestOption) (r *SmartTieredCacheService)

NewSmartTieredCacheService 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 (*SmartTieredCacheService) Delete

Remvoves enablement of Smart Tiered Cache

func (*SmartTieredCacheService) Edit

Updates enablement of Tiered Cache

func (*SmartTieredCacheService) Get

Get Smart Tiered Cache setting

type VariantDeleteParams

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

type VariantDeleteResponseEnvelope

type VariantDeleteResponseEnvelope struct {
	Errors   []VariantDeleteResponseEnvelopeErrors   `json:"errors,required"`
	Messages []VariantDeleteResponseEnvelopeMessages `json:"messages,required"`
	// Variant support enables caching variants of images with certain file extensions
	// in addition to the original. This only applies when the origin server sends the
	// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
	// does not serve the variant requested, the response will not be cached. This will
	// be indicated with BYPASS cache status in the response headers.
	Result CacheVariants `json:"result,required"`
	// Whether the API call was successful
	Success VariantDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    variantDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*VariantDeleteResponseEnvelope) UnmarshalJSON

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

type VariantDeleteResponseEnvelopeErrors

type VariantDeleteResponseEnvelopeErrors struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    variantDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*VariantDeleteResponseEnvelopeErrors) UnmarshalJSON

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

type VariantDeleteResponseEnvelopeMessages

type VariantDeleteResponseEnvelopeMessages struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    variantDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*VariantDeleteResponseEnvelopeMessages) UnmarshalJSON

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

type VariantDeleteResponseEnvelopeSuccess

type VariantDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	VariantDeleteResponseEnvelopeSuccessTrue VariantDeleteResponseEnvelopeSuccess = true
)

type VariantEditParams

type VariantEditParams struct {
	// Identifier
	ZoneID param.Field[string] `path:"zone_id,required"`
	// Value of the zone setting.
	Value param.Field[VariantEditParamsValue] `json:"value,required"`
}

func (VariantEditParams) MarshalJSON

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

type VariantEditParamsValue

type VariantEditParamsValue struct {
	// List of strings with the MIME types of all the variants that should be served
	// for avif.
	Avif param.Field[[]interface{}] `json:"avif"`
	// List of strings with the MIME types of all the variants that should be served
	// for bmp.
	Bmp param.Field[[]interface{}] `json:"bmp"`
	// List of strings with the MIME types of all the variants that should be served
	// for gif.
	Gif param.Field[[]interface{}] `json:"gif"`
	// List of strings with the MIME types of all the variants that should be served
	// for jp2.
	Jp2 param.Field[[]interface{}] `json:"jp2"`
	// List of strings with the MIME types of all the variants that should be served
	// for jpeg.
	Jpeg param.Field[[]interface{}] `json:"jpeg"`
	// List of strings with the MIME types of all the variants that should be served
	// for jpg.
	Jpg param.Field[[]interface{}] `json:"jpg"`
	// List of strings with the MIME types of all the variants that should be served
	// for jpg2.
	Jpg2 param.Field[[]interface{}] `json:"jpg2"`
	// List of strings with the MIME types of all the variants that should be served
	// for png.
	Png param.Field[[]interface{}] `json:"png"`
	// List of strings with the MIME types of all the variants that should be served
	// for tif.
	Tif param.Field[[]interface{}] `json:"tif"`
	// List of strings with the MIME types of all the variants that should be served
	// for tiff.
	Tiff param.Field[[]interface{}] `json:"tiff"`
	// List of strings with the MIME types of all the variants that should be served
	// for webp.
	Webp param.Field[[]interface{}] `json:"webp"`
}

Value of the zone setting.

func (VariantEditParamsValue) MarshalJSON

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

type VariantEditResponse

type VariantEditResponse struct {
	// ID of the zone setting.
	ID VariantEditResponseID `json:"id,required"`
	// last time this setting was modified.
	ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
	// Value of the zone setting.
	Value VariantEditResponseValue `json:"value,required"`
	JSON  variantEditResponseJSON  `json:"-"`
}

Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.

func (*VariantEditResponse) UnmarshalJSON

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

type VariantEditResponseEnvelope

type VariantEditResponseEnvelope struct {
	Errors   []VariantEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []VariantEditResponseEnvelopeMessages `json:"messages,required"`
	// Variant support enables caching variants of images with certain file extensions
	// in addition to the original. This only applies when the origin server sends the
	// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
	// does not serve the variant requested, the response will not be cached. This will
	// be indicated with BYPASS cache status in the response headers.
	Result VariantEditResponse `json:"result,required"`
	// Whether the API call was successful
	Success VariantEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    variantEditResponseEnvelopeJSON    `json:"-"`
}

func (*VariantEditResponseEnvelope) UnmarshalJSON

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

type VariantEditResponseEnvelopeErrors

type VariantEditResponseEnvelopeErrors struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    variantEditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*VariantEditResponseEnvelopeErrors) UnmarshalJSON

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

type VariantEditResponseEnvelopeMessages

type VariantEditResponseEnvelopeMessages struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    variantEditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*VariantEditResponseEnvelopeMessages) UnmarshalJSON

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

type VariantEditResponseEnvelopeSuccess

type VariantEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	VariantEditResponseEnvelopeSuccessTrue VariantEditResponseEnvelopeSuccess = true
)

type VariantEditResponseID

type VariantEditResponseID string

ID of the zone setting.

const (
	VariantEditResponseIDVariants VariantEditResponseID = "variants"
)

type VariantEditResponseValue

type VariantEditResponseValue struct {
	// List of strings with the MIME types of all the variants that should be served
	// for avif.
	Avif []interface{} `json:"avif"`
	// List of strings with the MIME types of all the variants that should be served
	// for bmp.
	Bmp []interface{} `json:"bmp"`
	// List of strings with the MIME types of all the variants that should be served
	// for gif.
	Gif []interface{} `json:"gif"`
	// List of strings with the MIME types of all the variants that should be served
	// for jp2.
	Jp2 []interface{} `json:"jp2"`
	// List of strings with the MIME types of all the variants that should be served
	// for jpeg.
	Jpeg []interface{} `json:"jpeg"`
	// List of strings with the MIME types of all the variants that should be served
	// for jpg.
	Jpg []interface{} `json:"jpg"`
	// List of strings with the MIME types of all the variants that should be served
	// for jpg2.
	Jpg2 []interface{} `json:"jpg2"`
	// List of strings with the MIME types of all the variants that should be served
	// for png.
	Png []interface{} `json:"png"`
	// List of strings with the MIME types of all the variants that should be served
	// for tif.
	Tif []interface{} `json:"tif"`
	// List of strings with the MIME types of all the variants that should be served
	// for tiff.
	Tiff []interface{} `json:"tiff"`
	// List of strings with the MIME types of all the variants that should be served
	// for webp.
	Webp []interface{}                `json:"webp"`
	JSON variantEditResponseValueJSON `json:"-"`
}

Value of the zone setting.

func (*VariantEditResponseValue) UnmarshalJSON

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

type VariantGetParams

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

type VariantGetResponse

type VariantGetResponse struct {
	// ID of the zone setting.
	ID VariantGetResponseID `json:"id,required"`
	// last time this setting was modified.
	ModifiedOn time.Time `json:"modified_on,required,nullable" format:"date-time"`
	// Value of the zone setting.
	Value VariantGetResponseValue `json:"value,required"`
	JSON  variantGetResponseJSON  `json:"-"`
}

Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.

func (*VariantGetResponse) UnmarshalJSON

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

type VariantGetResponseEnvelope

type VariantGetResponseEnvelope struct {
	Errors   []VariantGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []VariantGetResponseEnvelopeMessages `json:"messages,required"`
	// Variant support enables caching variants of images with certain file extensions
	// in addition to the original. This only applies when the origin server sends the
	// 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but
	// does not serve the variant requested, the response will not be cached. This will
	// be indicated with BYPASS cache status in the response headers.
	Result VariantGetResponse `json:"result,required"`
	// Whether the API call was successful
	Success VariantGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    variantGetResponseEnvelopeJSON    `json:"-"`
}

func (*VariantGetResponseEnvelope) UnmarshalJSON

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

type VariantGetResponseEnvelopeErrors

type VariantGetResponseEnvelopeErrors struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    variantGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*VariantGetResponseEnvelopeErrors) UnmarshalJSON

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

type VariantGetResponseEnvelopeMessages

type VariantGetResponseEnvelopeMessages struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    variantGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*VariantGetResponseEnvelopeMessages) UnmarshalJSON

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

type VariantGetResponseEnvelopeSuccess

type VariantGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	VariantGetResponseEnvelopeSuccessTrue VariantGetResponseEnvelopeSuccess = true
)

type VariantGetResponseID

type VariantGetResponseID string

ID of the zone setting.

const (
	VariantGetResponseIDVariants VariantGetResponseID = "variants"
)

type VariantGetResponseValue

type VariantGetResponseValue struct {
	// List of strings with the MIME types of all the variants that should be served
	// for avif.
	Avif []interface{} `json:"avif"`
	// List of strings with the MIME types of all the variants that should be served
	// for bmp.
	Bmp []interface{} `json:"bmp"`
	// List of strings with the MIME types of all the variants that should be served
	// for gif.
	Gif []interface{} `json:"gif"`
	// List of strings with the MIME types of all the variants that should be served
	// for jp2.
	Jp2 []interface{} `json:"jp2"`
	// List of strings with the MIME types of all the variants that should be served
	// for jpeg.
	Jpeg []interface{} `json:"jpeg"`
	// List of strings with the MIME types of all the variants that should be served
	// for jpg.
	Jpg []interface{} `json:"jpg"`
	// List of strings with the MIME types of all the variants that should be served
	// for jpg2.
	Jpg2 []interface{} `json:"jpg2"`
	// List of strings with the MIME types of all the variants that should be served
	// for png.
	Png []interface{} `json:"png"`
	// List of strings with the MIME types of all the variants that should be served
	// for tif.
	Tif []interface{} `json:"tif"`
	// List of strings with the MIME types of all the variants that should be served
	// for tiff.
	Tiff []interface{} `json:"tiff"`
	// List of strings with the MIME types of all the variants that should be served
	// for webp.
	Webp []interface{}               `json:"webp"`
	JSON variantGetResponseValueJSON `json:"-"`
}

Value of the zone setting.

func (*VariantGetResponseValue) UnmarshalJSON

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

type VariantService

type VariantService struct {
	Options []option.RequestOption
}

VariantService 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 NewVariantService method instead.

func NewVariantService

func NewVariantService(opts ...option.RequestOption) (r *VariantService)

NewVariantService 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 (*VariantService) Delete

func (r *VariantService) Delete(ctx context.Context, body VariantDeleteParams, opts ...option.RequestOption) (res *CacheVariants, err error)

Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.

func (*VariantService) Edit

Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.

func (*VariantService) Get

Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.

Jump to

Keyboard shortcuts

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