storage

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 12 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 CertificateCADigicert = shared.CertificateCADigicert

This is an alias to an internal value.

View Source
const CertificateCAGoogle = shared.CertificateCAGoogle

This is an alias to an internal value.

View Source
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt

This is an alias to an internal value.

View Source
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate

This is an alias to an internal value.

View Source
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC

This is an alias to an internal value.

View Source
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA

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.

View Source
const SortDirectionAsc = shared.SortDirectionAsc

This is an alias to an internal value.

View Source
const SortDirectionDesc = shared.SortDirectionDesc

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 AnalyticsListParams

type AnalyticsListParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// For specifying result metrics.
	Query param.Field[AnalyticsListParamsQuery] `query:"query"`
}

func (AnalyticsListParams) URLQuery

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

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

type AnalyticsListParamsQuery

type AnalyticsListParamsQuery struct {
	// Can be used to break down the data by given attributes.
	Dimensions param.Field[[]AnalyticsListParamsQueryDimension] `query:"dimensions"`
	// Used to filter rows by one or more dimensions. Filters can be combined using OR
	// and AND boolean logic. AND takes precedence over OR in all the expressions. The
	// OR operator is defined using a comma (,) or OR keyword surrounded by whitespace.
	// The AND operator is defined using a semicolon (;) or AND keyword surrounded by
	// whitespace. Note that the semicolon is a reserved character in URLs (rfc1738)
	// and needs to be percent-encoded as %3B. Comparison options are:
	//
	// | Operator | Name                     | URL Encoded |
	// | -------- | ------------------------ | ----------- |
	// | ==       | Equals                   | %3D%3D      |
	// | !=       | Does not equals          | !%3D        |
	// | >        | Greater Than             | %3E         |
	// | <        | Less Than                | %3C         |
	// | >=       | Greater than or equal to | %3E%3D      |
	// | <=       | Less than or equal to    | %3C%3D .    |
	Filters param.Field[string] `query:"filters"`
	// Limit number of returned metrics.
	Limit param.Field[int64] `query:"limit"`
	// One or more metrics to compute.
	Metrics param.Field[[]AnalyticsListParamsQueryMetric] `query:"metrics"`
	// Start of time interval to query, defaults to 6 hours before request received.
	Since param.Field[time.Time] `query:"since" format:"date-time"`
	// Array of dimensions or metrics to sort by, each dimension/metric may be prefixed
	// by - (descending) or + (ascending).
	Sort param.Field[[]interface{}] `query:"sort"`
	// End of time interval to query, defaults to current time.
	Until param.Field[time.Time] `query:"until" format:"date-time"`
}

For specifying result metrics.

func (AnalyticsListParamsQuery) URLQuery

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

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

type AnalyticsListParamsQueryDimension

type AnalyticsListParamsQueryDimension string

For drilling down on metrics.

const (
	AnalyticsListParamsQueryDimensionAccountID    AnalyticsListParamsQueryDimension = "accountId"
	AnalyticsListParamsQueryDimensionResponseCode AnalyticsListParamsQueryDimension = "responseCode"
	AnalyticsListParamsQueryDimensionRequestType  AnalyticsListParamsQueryDimension = "requestType"
)

func (AnalyticsListParamsQueryDimension) IsKnown

type AnalyticsListParamsQueryMetric

type AnalyticsListParamsQueryMetric string

A quantitative measurement of KV usage.

const (
	AnalyticsListParamsQueryMetricRequests AnalyticsListParamsQueryMetric = "requests"
	AnalyticsListParamsQueryMetricWriteKiB AnalyticsListParamsQueryMetric = "writeKiB"
	AnalyticsListParamsQueryMetricReadKiB  AnalyticsListParamsQueryMetric = "readKiB"
)

func (AnalyticsListParamsQueryMetric) IsKnown

type AnalyticsListResponseEnvelope

type AnalyticsListResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Metrics on Workers KV requests.
	Result Schema `json:"result,required"`
	// Whether the API call was successful
	Success AnalyticsListResponseEnvelopeSuccess `json:"success,required"`
	JSON    analyticsListResponseEnvelopeJSON    `json:"-"`
}

func (*AnalyticsListResponseEnvelope) UnmarshalJSON

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

type AnalyticsListResponseEnvelopeSuccess

type AnalyticsListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	AnalyticsListResponseEnvelopeSuccessTrue AnalyticsListResponseEnvelopeSuccess = true
)

func (AnalyticsListResponseEnvelopeSuccess) IsKnown

type AnalyticsService

type AnalyticsService struct {
	Options []option.RequestOption
}

AnalyticsService 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 NewAnalyticsService method instead.

func NewAnalyticsService

func NewAnalyticsService(opts ...option.RequestOption) (r *AnalyticsService)

NewAnalyticsService 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 (*AnalyticsService) List

func (r *AnalyticsService) List(ctx context.Context, params AnalyticsListParams, opts ...option.RequestOption) (res *Schema, err error)

Retrieves Workers KV request metrics for the given account.

func (*AnalyticsService) Stored

func (r *AnalyticsService) Stored(ctx context.Context, params AnalyticsStoredParams, opts ...option.RequestOption) (res *Components, err error)

Retrieves Workers KV stored data metrics for the given account.

type AnalyticsStoredParams

type AnalyticsStoredParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// For specifying result metrics.
	Query param.Field[AnalyticsStoredParamsQuery] `query:"query"`
}

func (AnalyticsStoredParams) URLQuery

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

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

type AnalyticsStoredParamsQuery

type AnalyticsStoredParamsQuery struct {
	// Can be used to break down the data by given attributes.
	Dimensions param.Field[[]AnalyticsStoredParamsQueryDimension] `query:"dimensions"`
	// Used to filter rows by one or more dimensions. Filters can be combined using OR
	// and AND boolean logic. AND takes precedence over OR in all the expressions. The
	// OR operator is defined using a comma (,) or OR keyword surrounded by whitespace.
	// The AND operator is defined using a semicolon (;) or AND keyword surrounded by
	// whitespace. Note that the semicolon is a reserved character in URLs (rfc1738)
	// and needs to be percent-encoded as %3B. Comparison options are:
	//
	// | Operator | Name                     | URL Encoded |
	// | -------- | ------------------------ | ----------- |
	// | ==       | Equals                   | %3D%3D      |
	// | !=       | Does not equals          | !%3D        |
	// | >        | Greater Than             | %3E         |
	// | <        | Less Than                | %3C         |
	// | >=       | Greater than or equal to | %3E%3D      |
	// | <=       | Less than or equal to    | %3C%3D .    |
	Filters param.Field[string] `query:"filters"`
	// Limit number of returned metrics.
	Limit param.Field[int64] `query:"limit"`
	// One or more metrics to compute.
	Metrics param.Field[[]AnalyticsStoredParamsQueryMetric] `query:"metrics"`
	// Start of time interval to query, defaults to 6 hours before request received.
	Since param.Field[time.Time] `query:"since" format:"date-time"`
	// Array of dimensions or metrics to sort by, each dimension/metric may be prefixed
	// by - (descending) or + (ascending).
	Sort param.Field[[]interface{}] `query:"sort"`
	// End of time interval to query, defaults to current time.
	Until param.Field[time.Time] `query:"until" format:"date-time"`
}

For specifying result metrics.

func (AnalyticsStoredParamsQuery) URLQuery

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

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

type AnalyticsStoredParamsQueryDimension

type AnalyticsStoredParamsQueryDimension string

For drilling down on metrics.

const (
	AnalyticsStoredParamsQueryDimensionNamespaceID AnalyticsStoredParamsQueryDimension = "namespaceId"
)

func (AnalyticsStoredParamsQueryDimension) IsKnown

type AnalyticsStoredParamsQueryMetric

type AnalyticsStoredParamsQueryMetric string

A quantitative measurement of KV usage.

const (
	AnalyticsStoredParamsQueryMetricStoredBytes AnalyticsStoredParamsQueryMetric = "storedBytes"
	AnalyticsStoredParamsQueryMetricStoredKeys  AnalyticsStoredParamsQueryMetric = "storedKeys"
)

func (AnalyticsStoredParamsQueryMetric) IsKnown

type AnalyticsStoredResponseEnvelope

type AnalyticsStoredResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Metrics on Workers KV requests.
	Result Components `json:"result,required"`
	// Whether the API call was successful
	Success AnalyticsStoredResponseEnvelopeSuccess `json:"success,required"`
	JSON    analyticsStoredResponseEnvelopeJSON    `json:"-"`
}

func (*AnalyticsStoredResponseEnvelope) UnmarshalJSON

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

type AnalyticsStoredResponseEnvelopeSuccess

type AnalyticsStoredResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	AnalyticsStoredResponseEnvelopeSuccessTrue AnalyticsStoredResponseEnvelopeSuccess = true
)

func (AnalyticsStoredResponseEnvelopeSuccess) IsKnown

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 CertificateCA added in v2.2.0

type CertificateCA = shared.CertificateCA

The Certificate Authority that will issue the certificate

This is an alias to an internal type.

type CertificateRequestType added in v2.2.0

type CertificateRequestType = shared.CertificateRequestType

Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).

This is an alias to an internal type.

type CloudflareTunnel

type CloudflareTunnel = shared.CloudflareTunnel

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

This is an alias to an internal type.

type CloudflareTunnelConnection

type CloudflareTunnelConnection = shared.CloudflareTunnelConnection

This is an alias to an internal type.

type CloudflareTunnelTunType

type CloudflareTunnelTunType = shared.CloudflareTunnelTunType

The type of tunnel.

This is an alias to an internal type.

type Components

type Components struct {
	Data []ComponentsData `json:"data,required,nullable"`
	// Number of seconds between current time and last processed event, i.e. how many
	// seconds of data could be missing.
	DataLag float64 `json:"data_lag,required"`
	// Maximum results for each metric.
	Max interface{} `json:"max,required"`
	// Minimum results for each metric.
	Min interface{} `json:"min,required"`
	// For specifying result metrics.
	Query ComponentsQuery `json:"query,required"`
	// Total number of rows in the result.
	Rows float64 `json:"rows,required"`
	// Total results for metrics across all data.
	Totals interface{}    `json:"totals,required"`
	JSON   componentsJSON `json:"-"`
}

Metrics on Workers KV requests.

func (*Components) UnmarshalJSON

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

type ComponentsData

type ComponentsData struct {
	// List of metrics returned by the query.
	Metrics []interface{}      `json:"metrics,required"`
	JSON    componentsDataJSON `json:"-"`
}

func (*ComponentsData) UnmarshalJSON

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

type ComponentsQuery

type ComponentsQuery struct {
	// Can be used to break down the data by given attributes.
	Dimensions []string `json:"dimensions"`
	// Used to filter rows by one or more dimensions. Filters can be combined using OR
	// and AND boolean logic. AND takes precedence over OR in all the expressions. The
	// OR operator is defined using a comma (,) or OR keyword surrounded by whitespace.
	// The AND operator is defined using a semicolon (;) or AND keyword surrounded by
	// whitespace. Note that the semicolon is a reserved character in URLs (rfc1738)
	// and needs to be percent-encoded as %3B. Comparison options are:
	//
	// | Operator | Name                     | URL Encoded |
	// | -------- | ------------------------ | ----------- |
	// | ==       | Equals                   | %3D%3D      |
	// | !=       | Does not equals          | !%3D        |
	// | >        | Greater Than             | %3E         |
	// | <        | Less Than                | %3C         |
	// | >=       | Greater than or equal to | %3E%3D      |
	// | <=       | Less than or equal to    | %3C%3D .    |
	Filters string `json:"filters"`
	// Limit number of returned metrics.
	Limit int64 `json:"limit"`
	// One or more metrics to compute.
	Metrics []string `json:"metrics"`
	// Start of time interval to query, defaults to 6 hours before request received.
	Since time.Time `json:"since" format:"date-time"`
	// Array of dimensions or metrics to sort by, each dimension/metric may be prefixed
	// by - (descending) or + (ascending).
	Sort []interface{} `json:"sort"`
	// End of time interval to query, defaults to current time.
	Until time.Time           `json:"until" format:"date-time"`
	JSON  componentsQueryJSON `json:"-"`
}

For specifying result metrics.

func (*ComponentsQuery) UnmarshalJSON

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

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 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 Schema

type Schema struct {
	Data []SchemaData `json:"data,required,nullable"`
	// Number of seconds between current time and last processed event, i.e. how many
	// seconds of data could be missing.
	DataLag float64 `json:"data_lag,required"`
	// Maximum results for each metric.
	Max interface{} `json:"max,required"`
	// Minimum results for each metric.
	Min interface{} `json:"min,required"`
	// For specifying result metrics.
	Query SchemaQuery `json:"query,required"`
	// Total number of rows in the result.
	Rows float64 `json:"rows,required"`
	// Total results for metrics across all data.
	Totals interface{} `json:"totals,required"`
	JSON   schemaJSON  `json:"-"`
}

Metrics on Workers KV requests.

func (*Schema) UnmarshalJSON

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

type SchemaData

type SchemaData struct {
	// List of metrics returned by the query.
	Metrics []interface{}  `json:"metrics,required"`
	JSON    schemaDataJSON `json:"-"`
}

func (*SchemaData) UnmarshalJSON

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

type SchemaQuery

type SchemaQuery struct {
	// Can be used to break down the data by given attributes.
	Dimensions []string `json:"dimensions"`
	// Used to filter rows by one or more dimensions. Filters can be combined using OR
	// and AND boolean logic. AND takes precedence over OR in all the expressions. The
	// OR operator is defined using a comma (,) or OR keyword surrounded by whitespace.
	// The AND operator is defined using a semicolon (;) or AND keyword surrounded by
	// whitespace. Note that the semicolon is a reserved character in URLs (rfc1738)
	// and needs to be percent-encoded as %3B. Comparison options are:
	//
	// | Operator | Name                     | URL Encoded |
	// | -------- | ------------------------ | ----------- |
	// | ==       | Equals                   | %3D%3D      |
	// | !=       | Does not equals          | !%3D        |
	// | >        | Greater Than             | %3E         |
	// | <        | Less Than                | %3C         |
	// | >=       | Greater than or equal to | %3E%3D      |
	// | <=       | Less than or equal to    | %3C%3D .    |
	Filters string `json:"filters"`
	// Limit number of returned metrics.
	Limit int64 `json:"limit"`
	// One or more metrics to compute.
	Metrics []string `json:"metrics"`
	// Start of time interval to query, defaults to 6 hours before request received.
	Since time.Time `json:"since" format:"date-time"`
	// Array of dimensions or metrics to sort by, each dimension/metric may be prefixed
	// by - (descending) or + (ascending).
	Sort []interface{} `json:"sort"`
	// End of time interval to query, defaults to current time.
	Until time.Time       `json:"until" format:"date-time"`
	JSON  schemaQueryJSON `json:"-"`
}

For specifying result metrics.

func (*SchemaQuery) UnmarshalJSON

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

type SortDirection added in v2.2.0

type SortDirection = shared.SortDirection

Direction to order DNS records in.

This is an alias to an internal type.

type StorageService

type StorageService struct {
	Options   []option.RequestOption
	Analytics *AnalyticsService
}

StorageService 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 NewStorageService method instead.

func NewStorageService

func NewStorageService(opts ...option.RequestOption) (r *StorageService)

NewStorageService 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.

Jump to

Keyboard shortcuts

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