package cluster

import (
	"fmt"
	"net/url"
)

const (
	TiDBNameFormat = "%s-tidb"

	TiDBGroupNameFormat = "%s-%s-tidb"
)

func ServiceURL(scheme, namespace, service, port string) *url.URL {
	// The schema is valid so url.Parse never returns an error.
	result, _ := url.Parse(fmt.Sprintf("%s://%s.%s.svc:%s", scheme, service, namespace, port))
	return result
}
