package main

type ClusterInfo struct {
	// Token is the bearer token for tenant EKS
	Token string `json:"token"`
	// EksArn is the ARN for the tenant eks cluster
	EksArn string `json:"eksArn"`
	// Endpoint is the domain name for the EKS apiserver
	Endpoint string `json:"endpoint"`
}

type BootstrapRequest struct {
	// ServiceDNS is the overwritten DNS records for public services (e.g. Auth0)
	// The IPs will be resolved to endpoint services hosted by TiDB cloud.
	// Key is the DNS name, value is the IP.
	ServiceDNS map[string]string `json:"serviceDNS"`
	// FrpcImage is the image for frpc.
	FrpcImage string `json:"frpcImage"`
	// FrpsEndpointSvc is the endpoint service for frps.
	FrpsEndpointSvc string `json:"frpsEndpointSvc"`
}

type Request struct {
	ClusterInfo
	*BootstrapRequest `json:",omitempty,inline"`
	Status            bool `json:"status,omitempty"`
}

type BootstrapResponse struct {
	FrpcConfigMap  string `json:"frpcConfigMap"`
	FrpcDeployment string `json:"frpcDeployment"`
	CoreDNSData    string `json:"coreDNSData"`
}

type Response struct {
	BootstrapResponse `json:",omitempty,inline"`
	Ready             *bool `json:"ready,omitempty"`
}
