Documentation ¶
Index ¶
- Constants
- type ASN
- type ASNParam
- type AuditLog
- type AuditLogAction
- type AuditLogActor
- type AuditLogActorType
- type AuditLogOwner
- type AuditLogResource
- type CertificateCA
- type CertificateRequestType
- type CloudflareTunnel
- type CloudflareTunnelConnection
- type CloudflareTunnelStatus
- type CloudflareTunnelTunType
- type D1
- type D1Service
- type DatabaseDeleteParams
- type DatabaseDeleteResponseEnvelope
- type DatabaseDeleteResponseEnvelopeSuccess
- type DatabaseDeleteResponseUnion
- type DatabaseGetParams
- type DatabaseGetResponseEnvelope
- type DatabaseGetResponseEnvelopeSuccess
- type DatabaseListParams
- type DatabaseListResponse
- type DatabaseNewParams
- type DatabaseNewParamsPrimaryLocationHint
- type DatabaseNewResponse
- type DatabaseNewResponseEnvelope
- type DatabaseNewResponseEnvelopeSuccess
- type DatabaseQueryParams
- type DatabaseQueryResponseEnvelope
- type DatabaseQueryResponseEnvelopeSuccess
- type DatabaseRawParams
- type DatabaseRawResponse
- type DatabaseRawResponseEnvelope
- type DatabaseRawResponseEnvelopeSuccess
- type DatabaseRawResponseMeta
- type DatabaseRawResponseResults
- type DatabaseRawResponseResultsRowsUnion
- type DatabaseService
- func (r *DatabaseService) Delete(ctx context.Context, databaseID string, body DatabaseDeleteParams, ...) (res *DatabaseDeleteResponseUnion, err error)
- func (r *DatabaseService) Get(ctx context.Context, databaseID string, query DatabaseGetParams, ...) (res *D1, err error)
- func (r *DatabaseService) List(ctx context.Context, params DatabaseListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[DatabaseListResponse], err error)
- func (r *DatabaseService) ListAutoPaging(ctx context.Context, params DatabaseListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[DatabaseListResponse]
- func (r *DatabaseService) New(ctx context.Context, params DatabaseNewParams, opts ...option.RequestOption) (res *DatabaseNewResponse, err error)
- func (r *DatabaseService) Query(ctx context.Context, databaseID string, params DatabaseQueryParams, ...) (res *[]QueryResult, err error)
- func (r *DatabaseService) Raw(ctx context.Context, databaseID string, params DatabaseRawParams, ...) (res *[]DatabaseRawResponse, err error)
- type Error
- type ErrorData
- type MemberParam
- type MemberRoleParam
- type MemberRolesPermissionsParam
- type MemberStatus
- type MemberUserParam
- type Permission
- type PermissionGrant
- type PermissionGrantParam
- type QueryResult
- type QueryResultMeta
- type ResponseInfo
- type Role
- type SortDirection
Constants ¶
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin
This is an alias to an internal value.
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare
This is an alias to an internal value.
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser
This is an alias to an internal value.
const CertificateCADigicert = shared.CertificateCADigicert
This is an alias to an internal value.
const CertificateCAGoogle = shared.CertificateCAGoogle
This is an alias to an internal value.
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt
This is an alias to an internal value.
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate
This is an alias to an internal value.
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC
This is an alias to an internal value.
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA
This is an alias to an internal value.
const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded
This is an alias to an internal value.
const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown
This is an alias to an internal value.
const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy
This is an alias to an internal value.
const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive
This is an alias to an internal value.
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI
This is an alias to an internal value.
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel
This is an alias to an internal value.
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE
This is an alias to an internal value.
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec
This is an alias to an internal value.
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector
This is an alias to an internal value.
const MemberStatusAccepted = shared.MemberStatusAccepted
This is an alias to an internal value.
const MemberStatusPending = shared.MemberStatusPending
This is an alias to an internal value.
const SortDirectionAsc = shared.SortDirectionAsc
This is an alias to an internal value.
const SortDirectionDesc = shared.SortDirectionDesc
This is an alias to an internal value.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditLogAction ¶
type AuditLogAction = shared.AuditLogAction
This is an alias to an internal type.
type AuditLogActor ¶
type AuditLogActor = shared.AuditLogActor
This is an alias to an internal type.
type AuditLogActorType ¶
type AuditLogActorType = shared.AuditLogActorType
The type of actor, whether a User, Cloudflare Admin, or an Automated System.
This is an alias to an internal type.
type AuditLogOwner ¶
type AuditLogOwner = shared.AuditLogOwner
This is an alias to an internal type.
type AuditLogResource ¶
type AuditLogResource = shared.AuditLogResource
This is an alias to an internal type.
type 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 CloudflareTunnelStatus ¶ added in v2.3.0
type CloudflareTunnelStatus = shared.CloudflareTunnelStatus
The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).
This is an alias to an internal type.
type CloudflareTunnelTunType ¶
type CloudflareTunnelTunType = shared.CloudflareTunnelTunType
The type of tunnel.
This is an alias to an internal type.
type D1 ¶
type D1 struct { // Specifies the timestamp the resource was created as an ISO8601 string. CreatedAt string `json:"created_at"` // The D1 database's size, in bytes. FileSize float64 `json:"file_size"` Name string `json:"name"` NumTables float64 `json:"num_tables"` UUID string `json:"uuid"` Version string `json:"version"` JSON d1JSON `json:"-"` }
func (*D1) UnmarshalJSON ¶
type D1Service ¶
type D1Service struct { Options []option.RequestOption Database *DatabaseService }
D1Service 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 NewD1Service method instead.
func NewD1Service ¶
func NewD1Service(opts ...option.RequestOption) (r *D1Service)
NewD1Service 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 DatabaseDeleteParams ¶ added in v2.3.0
type DatabaseDeleteResponseEnvelope ¶
type DatabaseDeleteResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result DatabaseDeleteResponseUnion `json:"result,required"` // Whether the API call was successful Success DatabaseDeleteResponseEnvelopeSuccess `json:"success,required"` JSON databaseDeleteResponseEnvelopeJSON `json:"-"` }
func (*DatabaseDeleteResponseEnvelope) UnmarshalJSON ¶
func (r *DatabaseDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type DatabaseDeleteResponseEnvelopeSuccess ¶
type DatabaseDeleteResponseEnvelopeSuccess bool
Whether the API call was successful
const (
DatabaseDeleteResponseEnvelopeSuccessTrue DatabaseDeleteResponseEnvelopeSuccess = true
)
func (DatabaseDeleteResponseEnvelopeSuccess) IsKnown ¶
func (r DatabaseDeleteResponseEnvelopeSuccess) IsKnown() bool
type DatabaseDeleteResponseUnion ¶
type DatabaseDeleteResponseUnion interface {
ImplementsD1DatabaseDeleteResponseUnion()
}
Union satisfied by d1.DatabaseDeleteResponseUnknown or shared.UnionString.
type DatabaseGetParams ¶ added in v2.3.0
type DatabaseGetResponseEnvelope ¶
type DatabaseGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result D1 `json:"result,required"` // Whether the API call was successful Success DatabaseGetResponseEnvelopeSuccess `json:"success,required"` JSON databaseGetResponseEnvelopeJSON `json:"-"` }
func (*DatabaseGetResponseEnvelope) UnmarshalJSON ¶
func (r *DatabaseGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type DatabaseGetResponseEnvelopeSuccess ¶
type DatabaseGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
DatabaseGetResponseEnvelopeSuccessTrue DatabaseGetResponseEnvelopeSuccess = true
)
func (DatabaseGetResponseEnvelopeSuccess) IsKnown ¶
func (r DatabaseGetResponseEnvelopeSuccess) IsKnown() bool
type DatabaseListParams ¶
type DatabaseListParams struct { // Account identifier tag. AccountID param.Field[string] `path:"account_id,required"` // a database name to search for. Name param.Field[string] `query:"name"` // Page number of paginated results. Page param.Field[float64] `query:"page"` // Number of items per page. PerPage param.Field[float64] `query:"per_page"` }
func (DatabaseListParams) URLQuery ¶
func (r DatabaseListParams) URLQuery() (v url.Values)
URLQuery serializes DatabaseListParams's query parameters as `url.Values`.
type DatabaseListResponse ¶
type DatabaseListResponse struct { // Specifies the timestamp the resource was created as an ISO8601 string. CreatedAt string `json:"created_at"` Name string `json:"name"` UUID string `json:"uuid"` Version string `json:"version"` JSON databaseListResponseJSON `json:"-"` }
func (*DatabaseListResponse) UnmarshalJSON ¶
func (r *DatabaseListResponse) UnmarshalJSON(data []byte) (err error)
type DatabaseNewParams ¶
type DatabaseNewParams struct { // Account identifier tag. AccountID param.Field[string] `path:"account_id,required"` Name param.Field[string] `json:"name,required"` // Specify the region to create the D1 primary, if available. If this option is // omitted, the D1 will be created as close as possible to the current user. PrimaryLocationHint param.Field[DatabaseNewParamsPrimaryLocationHint] `json:"primary_location_hint"` }
func (DatabaseNewParams) MarshalJSON ¶
func (r DatabaseNewParams) MarshalJSON() (data []byte, err error)
type DatabaseNewParamsPrimaryLocationHint ¶ added in v2.4.0
type DatabaseNewParamsPrimaryLocationHint string
Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user.
const ( DatabaseNewParamsPrimaryLocationHintWnam DatabaseNewParamsPrimaryLocationHint = "wnam" DatabaseNewParamsPrimaryLocationHintEnam DatabaseNewParamsPrimaryLocationHint = "enam" DatabaseNewParamsPrimaryLocationHintWeur DatabaseNewParamsPrimaryLocationHint = "weur" DatabaseNewParamsPrimaryLocationHintEeur DatabaseNewParamsPrimaryLocationHint = "eeur" DatabaseNewParamsPrimaryLocationHintApac DatabaseNewParamsPrimaryLocationHint = "apac" DatabaseNewParamsPrimaryLocationHintOc DatabaseNewParamsPrimaryLocationHint = "oc" )
func (DatabaseNewParamsPrimaryLocationHint) IsKnown ¶ added in v2.4.0
func (r DatabaseNewParamsPrimaryLocationHint) IsKnown() bool
type DatabaseNewResponse ¶
type DatabaseNewResponse struct { // Specifies the timestamp the resource was created as an ISO8601 string. CreatedAt string `json:"created_at"` Name string `json:"name"` UUID string `json:"uuid"` Version string `json:"version"` JSON databaseNewResponseJSON `json:"-"` }
func (*DatabaseNewResponse) UnmarshalJSON ¶
func (r *DatabaseNewResponse) UnmarshalJSON(data []byte) (err error)
type DatabaseNewResponseEnvelope ¶
type DatabaseNewResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result DatabaseNewResponse `json:"result,required"` // Whether the API call was successful Success DatabaseNewResponseEnvelopeSuccess `json:"success,required"` JSON databaseNewResponseEnvelopeJSON `json:"-"` }
func (*DatabaseNewResponseEnvelope) UnmarshalJSON ¶
func (r *DatabaseNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type DatabaseNewResponseEnvelopeSuccess ¶
type DatabaseNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
DatabaseNewResponseEnvelopeSuccessTrue DatabaseNewResponseEnvelopeSuccess = true
)
func (DatabaseNewResponseEnvelopeSuccess) IsKnown ¶
func (r DatabaseNewResponseEnvelopeSuccess) IsKnown() bool
type DatabaseQueryParams ¶
type DatabaseQueryParams struct { // Account identifier tag. AccountID param.Field[string] `path:"account_id,required"` // Your SQL query. Supports multiple statements, joined by semicolons, which will // be executed as a batch. Sql param.Field[string] `json:"sql,required"` Params param.Field[[]string] `json:"params"` }
func (DatabaseQueryParams) MarshalJSON ¶
func (r DatabaseQueryParams) MarshalJSON() (data []byte, err error)
type DatabaseQueryResponseEnvelope ¶
type DatabaseQueryResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result []QueryResult `json:"result,required"` // Whether the API call was successful Success DatabaseQueryResponseEnvelopeSuccess `json:"success,required"` JSON databaseQueryResponseEnvelopeJSON `json:"-"` }
func (*DatabaseQueryResponseEnvelope) UnmarshalJSON ¶
func (r *DatabaseQueryResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type DatabaseQueryResponseEnvelopeSuccess ¶
type DatabaseQueryResponseEnvelopeSuccess bool
Whether the API call was successful
const (
DatabaseQueryResponseEnvelopeSuccessTrue DatabaseQueryResponseEnvelopeSuccess = true
)
func (DatabaseQueryResponseEnvelopeSuccess) IsKnown ¶
func (r DatabaseQueryResponseEnvelopeSuccess) IsKnown() bool
type DatabaseRawParams ¶ added in v2.3.0
type DatabaseRawParams struct { // Account identifier tag. AccountID param.Field[string] `path:"account_id,required"` // Your SQL query. Supports multiple statements, joined by semicolons, which will // be executed as a batch. Sql param.Field[string] `json:"sql,required"` Params param.Field[[]string] `json:"params"` }
func (DatabaseRawParams) MarshalJSON ¶ added in v2.3.0
func (r DatabaseRawParams) MarshalJSON() (data []byte, err error)
type DatabaseRawResponse ¶ added in v2.3.0
type DatabaseRawResponse struct { Meta DatabaseRawResponseMeta `json:"meta"` Results DatabaseRawResponseResults `json:"results"` Success bool `json:"success"` JSON databaseRawResponseJSON `json:"-"` }
func (*DatabaseRawResponse) UnmarshalJSON ¶ added in v2.3.0
func (r *DatabaseRawResponse) UnmarshalJSON(data []byte) (err error)
type DatabaseRawResponseEnvelope ¶ added in v2.3.0
type DatabaseRawResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result []DatabaseRawResponse `json:"result,required"` // Whether the API call was successful Success DatabaseRawResponseEnvelopeSuccess `json:"success,required"` JSON databaseRawResponseEnvelopeJSON `json:"-"` }
func (*DatabaseRawResponseEnvelope) UnmarshalJSON ¶ added in v2.3.0
func (r *DatabaseRawResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type DatabaseRawResponseEnvelopeSuccess ¶ added in v2.3.0
type DatabaseRawResponseEnvelopeSuccess bool
Whether the API call was successful
const (
DatabaseRawResponseEnvelopeSuccessTrue DatabaseRawResponseEnvelopeSuccess = true
)
func (DatabaseRawResponseEnvelopeSuccess) IsKnown ¶ added in v2.3.0
func (r DatabaseRawResponseEnvelopeSuccess) IsKnown() bool
type DatabaseRawResponseMeta ¶ added in v2.3.0
type DatabaseRawResponseMeta struct { ChangedDB bool `json:"changed_db"` Changes float64 `json:"changes"` Duration float64 `json:"duration"` LastRowID float64 `json:"last_row_id"` RowsRead float64 `json:"rows_read"` RowsWritten float64 `json:"rows_written"` SizeAfter float64 `json:"size_after"` JSON databaseRawResponseMetaJSON `json:"-"` }
func (*DatabaseRawResponseMeta) UnmarshalJSON ¶ added in v2.3.0
func (r *DatabaseRawResponseMeta) UnmarshalJSON(data []byte) (err error)
type DatabaseRawResponseResults ¶ added in v2.3.0
type DatabaseRawResponseResults struct { Columns []string `json:"columns"` Rows [][]DatabaseRawResponseResultsRowsUnion `json:"rows"` JSON databaseRawResponseResultsJSON `json:"-"` }
func (*DatabaseRawResponseResults) UnmarshalJSON ¶ added in v2.3.0
func (r *DatabaseRawResponseResults) UnmarshalJSON(data []byte) (err error)
type DatabaseRawResponseResultsRowsUnion ¶ added in v2.3.0
type DatabaseRawResponseResultsRowsUnion interface {
ImplementsD1DatabaseRawResponseResultsRowsUnion()
}
Union satisfied by shared.UnionFloat, shared.UnionString or d1.DatabaseRawResponseResultsRowsUnknown.
type DatabaseService ¶
type DatabaseService struct {
Options []option.RequestOption
}
DatabaseService 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 NewDatabaseService method instead.
func NewDatabaseService ¶
func NewDatabaseService(opts ...option.RequestOption) (r *DatabaseService)
NewDatabaseService 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 (*DatabaseService) Delete ¶
func (r *DatabaseService) Delete(ctx context.Context, databaseID string, body DatabaseDeleteParams, opts ...option.RequestOption) (res *DatabaseDeleteResponseUnion, err error)
Deletes the specified D1 database.
func (*DatabaseService) Get ¶
func (r *DatabaseService) Get(ctx context.Context, databaseID string, query DatabaseGetParams, opts ...option.RequestOption) (res *D1, err error)
Returns the specified D1 database.
func (*DatabaseService) List ¶
func (r *DatabaseService) List(ctx context.Context, params DatabaseListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[DatabaseListResponse], err error)
Returns a list of D1 databases.
func (*DatabaseService) ListAutoPaging ¶
func (r *DatabaseService) ListAutoPaging(ctx context.Context, params DatabaseListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[DatabaseListResponse]
Returns a list of D1 databases.
func (*DatabaseService) New ¶
func (r *DatabaseService) New(ctx context.Context, params DatabaseNewParams, opts ...option.RequestOption) (res *DatabaseNewResponse, err error)
Returns the created D1 database.
func (*DatabaseService) Query ¶
func (r *DatabaseService) Query(ctx context.Context, databaseID string, params DatabaseQueryParams, opts ...option.RequestOption) (res *[]QueryResult, err error)
Returns the query result as an object.
func (*DatabaseService) Raw ¶ added in v2.3.0
func (r *DatabaseService) Raw(ctx context.Context, databaseID string, params DatabaseRawParams, opts ...option.RequestOption) (res *[]DatabaseRawResponse, err error)
Returns the query result rows as arrays rather than objects. This is a performance-optimized version of the /query endpoint.
type MemberParam ¶ added in v2.1.0
type MemberParam = shared.MemberParam
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 MemberRolesPermissionsParam ¶ added in v2.1.0
type MemberRolesPermissionsParam = shared.MemberRolesPermissionsParam
This is an alias to an internal type.
type MemberStatus ¶ added in v2.3.0
type MemberStatus = shared.MemberStatus
A member's status in the account.
This is an alias to an internal type.
type MemberUserParam ¶ added in v2.1.0
type MemberUserParam = shared.MemberUserParam
Details of the user associated to the membership.
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 QueryResult ¶
type QueryResult struct { Meta QueryResultMeta `json:"meta"` Results []interface{} `json:"results"` Success bool `json:"success"` JSON queryResultJSON `json:"-"` }
func (*QueryResult) UnmarshalJSON ¶
func (r *QueryResult) UnmarshalJSON(data []byte) (err error)
type QueryResultMeta ¶
type QueryResultMeta struct { ChangedDB bool `json:"changed_db"` Changes float64 `json:"changes"` Duration float64 `json:"duration"` LastRowID float64 `json:"last_row_id"` RowsRead float64 `json:"rows_read"` RowsWritten float64 `json:"rows_written"` SizeAfter float64 `json:"size_after"` JSON queryResultMetaJSON `json:"-"` }
func (*QueryResultMeta) UnmarshalJSON ¶
func (r *QueryResultMeta) 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.