package cluster

import (
	"fmt"
	"net/http"

	"github.com/tidbcloud/config-service/pkg/pdapi"
)

type PDProxy struct {
	host   string
	client *http.Client
	auth   pdapi.PDAuth
}

func (p *PDProxy) GetPDClient(clusterId int64) pdapi.DynamicPDClient {
	return pdapi.New(fmt.Sprintf("https://%s/proxy/cluster/%d/pd", p.host, clusterId), p.client, p.auth)
}
