github.com/supabase/cli@v1.168.1/internal/utils/cloudflare/api.go (about) 1 package cloudflare 2 3 import ( 4 "net/http" 5 "time" 6 7 "github.com/supabase/cli/pkg/fetcher" 8 ) 9 10 type CloudflareAPI struct { 11 *fetcher.Fetcher 12 } 13 14 func NewCloudflareAPI() CloudflareAPI { 15 server := "https://1.1.1.1" 16 client := &http.Client{ 17 Timeout: 10 * time.Second, 18 } 19 header := func(req *http.Request) { 20 req.Header.Add("accept", "application/dns-json") 21 } 22 api := CloudflareAPI{Fetcher: fetcher.NewFetcher( 23 server, 24 fetcher.WithHTTPClient(client), 25 fetcher.WithRequestEditor(header), 26 )} 27 return api 28 }