Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 716 Bytes

File metadata and controls

38 lines (29 loc) · 716 Bytes

Configuration

Required:

  • AccountID
  • APIToken

Usually required:

  • DatabaseID

DatabaseID is optional if you only use methods that accept an explicit database ID, such as RawIn or GetDatabase.

client := d1http.New(d1http.Config{
    AccountID:  "...",
    DatabaseID: "...",
    APIToken:   "...",
})

Advanced:

client := d1http.New(d1http.Config{
    AccountID:  "...",
    DatabaseID: "...",
    APIToken:   "...",
    BaseURL:    "https://api.cloudflare.com/client/v4",
    HTTPClient: &http.Client{Timeout: 30 * time.Second},
    Retry: d1http.RetryConfig{
        MaxRetries: 3,
        MinBackoff: 200 * time.Millisecond,
        MaxBackoff: 2 * time.Second,
    },
})