Documentation ¶
Index ¶
- type AnalyticsListParams
- type AnalyticsListParamsQuery
- type AnalyticsListParamsQueryDimension
- type AnalyticsListParamsQueryMetric
- type AnalyticsListResponseEnvelope
- type AnalyticsListResponseEnvelopeErrors
- type AnalyticsListResponseEnvelopeMessages
- type AnalyticsListResponseEnvelopeSuccess
- type AnalyticsService
- type AnalyticsStoredParams
- type AnalyticsStoredParamsQuery
- type AnalyticsStoredParamsQueryDimension
- type AnalyticsStoredParamsQueryMetric
- type AnalyticsStoredResponseEnvelope
- type AnalyticsStoredResponseEnvelopeErrors
- type AnalyticsStoredResponseEnvelopeMessages
- type AnalyticsStoredResponseEnvelopeSuccess
- type Error
- type StorageService
- type WorkersKVComponentsSchemasResult
- type WorkersKVComponentsSchemasResultData
- type WorkersKVComponentsSchemasResultQuery
- type WorkersKVSchemasResult
- type WorkersKVSchemasResultData
- type WorkersKVSchemasResultQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 ¶
func (r AnalyticsListParamsQueryDimension) IsKnown() bool
type AnalyticsListParamsQueryMetric ¶
type AnalyticsListParamsQueryMetric string
A quantitative measurement of KV usage.
const ( AnalyticsListParamsQueryMetricRequests AnalyticsListParamsQueryMetric = "requests" AnalyticsListParamsQueryMetricWriteKiB AnalyticsListParamsQueryMetric = "writeKiB" AnalyticsListParamsQueryMetricReadKiB AnalyticsListParamsQueryMetric = "readKiB" )
func (AnalyticsListParamsQueryMetric) IsKnown ¶
func (r AnalyticsListParamsQueryMetric) IsKnown() bool
type AnalyticsListResponseEnvelope ¶
type AnalyticsListResponseEnvelope struct { Errors []AnalyticsListResponseEnvelopeErrors `json:"errors,required"` Messages []AnalyticsListResponseEnvelopeMessages `json:"messages,required"` // Metrics on Workers KV requests. Result WorkersKVSchemasResult `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 AnalyticsListResponseEnvelopeErrors ¶
type AnalyticsListResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON analyticsListResponseEnvelopeErrorsJSON `json:"-"` }
func (*AnalyticsListResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *AnalyticsListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type AnalyticsListResponseEnvelopeMessages ¶
type AnalyticsListResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON analyticsListResponseEnvelopeMessagesJSON `json:"-"` }
func (*AnalyticsListResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *AnalyticsListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type AnalyticsListResponseEnvelopeSuccess ¶
type AnalyticsListResponseEnvelopeSuccess bool
Whether the API call was successful
const (
AnalyticsListResponseEnvelopeSuccessTrue AnalyticsListResponseEnvelopeSuccess = true
)
func (AnalyticsListResponseEnvelopeSuccess) IsKnown ¶
func (r AnalyticsListResponseEnvelopeSuccess) IsKnown() bool
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 *WorkersKVSchemasResult, 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 *WorkersKVComponentsSchemasResult, 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 ¶
func (r AnalyticsStoredParamsQueryDimension) IsKnown() bool
type AnalyticsStoredParamsQueryMetric ¶
type AnalyticsStoredParamsQueryMetric string
A quantitative measurement of KV usage.
const ( AnalyticsStoredParamsQueryMetricStoredBytes AnalyticsStoredParamsQueryMetric = "storedBytes" AnalyticsStoredParamsQueryMetricStoredKeys AnalyticsStoredParamsQueryMetric = "storedKeys" )
func (AnalyticsStoredParamsQueryMetric) IsKnown ¶
func (r AnalyticsStoredParamsQueryMetric) IsKnown() bool
type AnalyticsStoredResponseEnvelope ¶
type AnalyticsStoredResponseEnvelope struct { Errors []AnalyticsStoredResponseEnvelopeErrors `json:"errors,required"` Messages []AnalyticsStoredResponseEnvelopeMessages `json:"messages,required"` // Metrics on Workers KV requests. Result WorkersKVComponentsSchemasResult `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 AnalyticsStoredResponseEnvelopeErrors ¶
type AnalyticsStoredResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON analyticsStoredResponseEnvelopeErrorsJSON `json:"-"` }
func (*AnalyticsStoredResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *AnalyticsStoredResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type AnalyticsStoredResponseEnvelopeMessages ¶
type AnalyticsStoredResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON analyticsStoredResponseEnvelopeMessagesJSON `json:"-"` }
func (*AnalyticsStoredResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *AnalyticsStoredResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type AnalyticsStoredResponseEnvelopeSuccess ¶
type AnalyticsStoredResponseEnvelopeSuccess bool
Whether the API call was successful
const (
AnalyticsStoredResponseEnvelopeSuccessTrue AnalyticsStoredResponseEnvelopeSuccess = true
)
func (AnalyticsStoredResponseEnvelopeSuccess) IsKnown ¶
func (r AnalyticsStoredResponseEnvelopeSuccess) IsKnown() bool
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.
type WorkersKVComponentsSchemasResult ¶
type WorkersKVComponentsSchemasResult struct { Data []WorkersKVComponentsSchemasResultData `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 WorkersKVComponentsSchemasResultQuery `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 workersKVComponentsSchemasResultJSON `json:"-"` }
Metrics on Workers KV requests.
func (*WorkersKVComponentsSchemasResult) UnmarshalJSON ¶
func (r *WorkersKVComponentsSchemasResult) UnmarshalJSON(data []byte) (err error)
type WorkersKVComponentsSchemasResultData ¶
type WorkersKVComponentsSchemasResultData struct { // List of metrics returned by the query. Metrics []interface{} `json:"metrics,required"` JSON workersKVComponentsSchemasResultDataJSON `json:"-"` }
func (*WorkersKVComponentsSchemasResultData) UnmarshalJSON ¶
func (r *WorkersKVComponentsSchemasResultData) UnmarshalJSON(data []byte) (err error)
type WorkersKVComponentsSchemasResultQuery ¶
type WorkersKVComponentsSchemasResultQuery 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 workersKVComponentsSchemasResultQueryJSON `json:"-"` }
For specifying result metrics.
func (*WorkersKVComponentsSchemasResultQuery) UnmarshalJSON ¶
func (r *WorkersKVComponentsSchemasResultQuery) UnmarshalJSON(data []byte) (err error)
type WorkersKVSchemasResult ¶
type WorkersKVSchemasResult struct { Data []WorkersKVSchemasResultData `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 WorkersKVSchemasResultQuery `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 workersKVSchemasResultJSON `json:"-"` }
Metrics on Workers KV requests.
func (*WorkersKVSchemasResult) UnmarshalJSON ¶
func (r *WorkersKVSchemasResult) UnmarshalJSON(data []byte) (err error)
type WorkersKVSchemasResultData ¶
type WorkersKVSchemasResultData struct { // List of metrics returned by the query. Metrics []interface{} `json:"metrics,required"` JSON workersKVSchemasResultDataJSON `json:"-"` }
func (*WorkersKVSchemasResultData) UnmarshalJSON ¶
func (r *WorkersKVSchemasResultData) UnmarshalJSON(data []byte) (err error)
type WorkersKVSchemasResultQuery ¶
type WorkersKVSchemasResultQuery 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 workersKVSchemasResultQueryJSON `json:"-"` }
For specifying result metrics.
func (*WorkersKVSchemasResultQuery) UnmarshalJSON ¶
func (r *WorkersKVSchemasResultQuery) UnmarshalJSON(data []byte) (err error)