package crossregion

import (
	"github.com/tidbcloud/tiinf/errs"
)

type EnvType string

const (
	Prod    EnvType = "prod"
	Staging EnvType = "staging"
	Dev     EnvType = "dev"
)

type AuthType string

const (
	BasicAuth AuthType = "basic-auth"
)

var GlobalInnerDomainMap = map[EnvType]string{
	Dev:     "https://inner-central.dev.tidbcloud.com",
	Staging: "https://inner-central.staging.tidbcloud.com",
	Prod:    "https://inner-central.prod.tidbcloud.com",
}

func GetO11yRegionInnerDomain(envType EnvType, region string) (string, error) {
	return "https://" + region + ".inner-region.o11y." + string(envType) + ".tidbcloud.com", nil
}

func GetGlobalInnerDomain(envType EnvType) (string, error) {
	if val, ok := GlobalInnerDomainMap[envType]; ok {
		return val, nil
	}
	return "", errs.NewNotFound("can not find globaldomain by env_type: "+string(envType), nil)
}
