Documentation
¶
Index ¶
- type D1CreateDatabase
- type D1DatabaseDetails
- type D1QueryResult
- type D1QueryResultMeta
- type D1Service
- type DatabaseDeleteResponse
- type DatabaseDeleteResponseEnvelope
- type DatabaseDeleteResponseEnvelopeErrors
- type DatabaseDeleteResponseEnvelopeMessages
- type DatabaseDeleteResponseEnvelopeSuccess
- type DatabaseGetResponseEnvelope
- type DatabaseGetResponseEnvelopeErrors
- type DatabaseGetResponseEnvelopeMessages
- type DatabaseGetResponseEnvelopeSuccess
- type DatabaseListParams
- type DatabaseNewParams
- type DatabaseNewResponseEnvelope
- type DatabaseNewResponseEnvelopeErrors
- type DatabaseNewResponseEnvelopeMessages
- type DatabaseNewResponseEnvelopeSuccess
- type DatabaseQueryParams
- type DatabaseQueryResponseEnvelope
- type DatabaseQueryResponseEnvelopeErrors
- type DatabaseQueryResponseEnvelopeMessages
- type DatabaseQueryResponseEnvelopeSuccess
- type DatabaseService
- func (r *DatabaseService) Delete(ctx context.Context, accountIdentifier string, databaseIdentifier string, ...) (res *DatabaseDeleteResponse, err error)
- func (r *DatabaseService) Get(ctx context.Context, accountIdentifier string, databaseIdentifier string, ...) (res *D1DatabaseDetails, err error)
- func (r *DatabaseService) List(ctx context.Context, params DatabaseListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[D1CreateDatabase], err error)
- func (r *DatabaseService) ListAutoPaging(ctx context.Context, params DatabaseListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[D1CreateDatabase]
- func (r *DatabaseService) New(ctx context.Context, params DatabaseNewParams, opts ...option.RequestOption) (res *D1CreateDatabase, err error)
- func (r *DatabaseService) Query(ctx context.Context, accountIdentifier string, databaseIdentifier string, ...) (res *[]D1QueryResult, err error)
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type D1CreateDatabase ¶
type D1CreateDatabase struct {
// Specifies the timestamp the resource was created as an ISO8601 string.
CreatedAt interface{} `json:"created_at"`
Name string `json:"name"`
UUID string `json:"uuid"`
Version string `json:"version"`
JSON d1CreateDatabaseJSON `json:"-"`
}
func (*D1CreateDatabase) UnmarshalJSON ¶
func (r *D1CreateDatabase) UnmarshalJSON(data []byte) (err error)
type D1DatabaseDetails ¶
type D1DatabaseDetails struct {
// Specifies the timestamp the resource was created as an ISO8601 string.
CreatedAt interface{} `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 d1DatabaseDetailsJSON `json:"-"`
}
func (*D1DatabaseDetails) UnmarshalJSON ¶
func (r *D1DatabaseDetails) UnmarshalJSON(data []byte) (err error)
type D1QueryResult ¶
type D1QueryResult struct {
Meta D1QueryResultMeta `json:"meta"`
Results []interface{} `json:"results"`
Success bool `json:"success"`
JSON d1QueryResultJSON `json:"-"`
}
func (*D1QueryResult) UnmarshalJSON ¶
func (r *D1QueryResult) UnmarshalJSON(data []byte) (err error)
type D1QueryResultMeta ¶
type D1QueryResultMeta 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 d1QueryResultMetaJSON `json:"-"`
}
func (*D1QueryResultMeta) UnmarshalJSON ¶
func (r *D1QueryResultMeta) UnmarshalJSON(data []byte) (err error)
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 DatabaseDeleteResponse ¶
type DatabaseDeleteResponse interface {
ImplementsD1DatabaseDeleteResponse()
}
Union satisfied by d1.DatabaseDeleteResponseUnknown or shared.UnionString.
type DatabaseDeleteResponseEnvelope ¶
type DatabaseDeleteResponseEnvelope struct {
Errors []DatabaseDeleteResponseEnvelopeErrors `json:"errors,required"`
Messages []DatabaseDeleteResponseEnvelopeMessages `json:"messages,required"`
Result DatabaseDeleteResponse `json:"result,required,nullable"`
// 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 DatabaseDeleteResponseEnvelopeErrors ¶
type DatabaseDeleteResponseEnvelopeErrors struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON databaseDeleteResponseEnvelopeErrorsJSON `json:"-"`
}
func (*DatabaseDeleteResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *DatabaseDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type DatabaseDeleteResponseEnvelopeMessages ¶
type DatabaseDeleteResponseEnvelopeMessages struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON databaseDeleteResponseEnvelopeMessagesJSON `json:"-"`
}
func (*DatabaseDeleteResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *DatabaseDeleteResponseEnvelopeMessages) 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 DatabaseGetResponseEnvelope ¶
type DatabaseGetResponseEnvelope struct {
Errors []DatabaseGetResponseEnvelopeErrors `json:"errors,required"`
Messages []DatabaseGetResponseEnvelopeMessages `json:"messages,required"`
Result D1DatabaseDetails `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 DatabaseGetResponseEnvelopeErrors ¶
type DatabaseGetResponseEnvelopeErrors struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON databaseGetResponseEnvelopeErrorsJSON `json:"-"`
}
func (*DatabaseGetResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *DatabaseGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type DatabaseGetResponseEnvelopeMessages ¶
type DatabaseGetResponseEnvelopeMessages struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON databaseGetResponseEnvelopeMessagesJSON `json:"-"`
}
func (*DatabaseGetResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *DatabaseGetResponseEnvelopeMessages) 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 DatabaseNewParams ¶
type DatabaseNewParams struct {
// Account identifier tag.
AccountID param.Field[string] `path:"account_id,required"`
Name param.Field[string] `json:"name,required"`
}
func (DatabaseNewParams) MarshalJSON ¶
func (r DatabaseNewParams) MarshalJSON() (data []byte, err error)
type DatabaseNewResponseEnvelope ¶
type DatabaseNewResponseEnvelope struct {
Errors []DatabaseNewResponseEnvelopeErrors `json:"errors,required"`
Messages []DatabaseNewResponseEnvelopeMessages `json:"messages,required"`
Result D1CreateDatabase `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 DatabaseNewResponseEnvelopeErrors ¶
type DatabaseNewResponseEnvelopeErrors struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON databaseNewResponseEnvelopeErrorsJSON `json:"-"`
}
func (*DatabaseNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *DatabaseNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type DatabaseNewResponseEnvelopeMessages ¶
type DatabaseNewResponseEnvelopeMessages struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON databaseNewResponseEnvelopeMessagesJSON `json:"-"`
}
func (*DatabaseNewResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *DatabaseNewResponseEnvelopeMessages) 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 {
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 []DatabaseQueryResponseEnvelopeErrors `json:"errors,required"`
Messages []DatabaseQueryResponseEnvelopeMessages `json:"messages,required"`
Result []D1QueryResult `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 DatabaseQueryResponseEnvelopeErrors ¶
type DatabaseQueryResponseEnvelopeErrors struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON databaseQueryResponseEnvelopeErrorsJSON `json:"-"`
}
func (*DatabaseQueryResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *DatabaseQueryResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type DatabaseQueryResponseEnvelopeMessages ¶
type DatabaseQueryResponseEnvelopeMessages struct {
Code int64 `json:"code,required"`
Message string `json:"message,required"`
JSON databaseQueryResponseEnvelopeMessagesJSON `json:"-"`
}
func (*DatabaseQueryResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *DatabaseQueryResponseEnvelopeMessages) 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 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, accountIdentifier string, databaseIdentifier string, opts ...option.RequestOption) (res *DatabaseDeleteResponse, err error)
Deletes the specified D1 database.
func (*DatabaseService) Get ¶
func (r *DatabaseService) Get(ctx context.Context, accountIdentifier string, databaseIdentifier string, opts ...option.RequestOption) (res *D1DatabaseDetails, err error)
Returns the specified D1 database.
func (*DatabaseService) List ¶
func (r *DatabaseService) List(ctx context.Context, params DatabaseListParams, opts ...option.RequestOption) (res *shared.V4PagePaginationArray[D1CreateDatabase], err error)
Returns a list of D1 databases.
func (*DatabaseService) ListAutoPaging ¶
func (r *DatabaseService) ListAutoPaging(ctx context.Context, params DatabaseListParams, opts ...option.RequestOption) *shared.V4PagePaginationArrayAutoPager[D1CreateDatabase]
Returns a list of D1 databases.
func (*DatabaseService) New ¶
func (r *DatabaseService) New(ctx context.Context, params DatabaseNewParams, opts ...option.RequestOption) (res *D1CreateDatabase, err error)
Returns the created D1 database.
func (*DatabaseService) Query ¶
func (r *DatabaseService) Query(ctx context.Context, accountIdentifier string, databaseIdentifier string, body DatabaseQueryParams, opts ...option.RequestOption) (res *[]D1QueryResult, err error)
Returns the query result.