nidus-sync/stadia/stadia.go
Eli Ribble daa8cb1748
Push geocoding down a layer
This makes it possible to always save address information from our
geocoder.
2026-03-04 18:29:52 +00:00

37 lines
698 B
Go

package stadia
import (
"crypto/tls"
"github.com/rs/zerolog/log"
"os"
"resty.dev/v3"
)
type StadiaMaps struct {
APIKey string
client *resty.Client
urlBase string
}
func NewStadiaMaps(api_key string) *StadiaMaps {
//logger := NewLogger(log.Logger)
//r := resty.New().SetLogger(logger).SetDebug(true)
//r := resty.New().SetDebug(true)
r := resty.New()
if os.Getenv("STADIA_INSECURE_SKIP_VERIFY") != "" {
log.Warn().Msg("Using insecure TLS verification settings")
r.SetTLSClientConfig(&tls.Config{
InsecureSkipVerify: true,
})
}
return &StadiaMaps{
APIKey: api_key,
client: r,
urlBase: "api.stadiamaps.com",
}
}
func (s *StadiaMaps) Close() {
s.client.Close()
}