package controller
import (
"github.com/goodrain/rainbond/pkg/component/mq"
"net/http"
"github.com/goodrain/rainbond/api/api"
"github.com/goodrain/rainbond/api/proxy"
"github.com/goodrain/rainbond/worker/client"
)
type V2Manager interface {
Show(w http.ResponseWriter, r *http.Request)
Health(w http.ResponseWriter, r *http.Request)
AlertManagerWebHook(w http.ResponseWriter, r *http.Request)
Version(w http.ResponseWriter, r *http.Request)
api.ClusterInterface
api.NodesInterface
api.TenantInterface
api.ServiceInterface
api.LogInterface
api.PluginInterface
api.RulesInterface
api.AppInterface
api.LongVersionInterface
api.Gatewayer
api.ThirdPartyServicer
api.Labeler
api.AppRestoreInterface
api.PodInterface
api.ApplicationInterface
api.RegistryAuthSecretInterface
api.HelmInterface
api.RegistryInterface
api.GatewayInterface
api.KubeBlocksInterface
}
var defaultV2Manager V2Manager
func CreateV2RouterManager(statusCli *client.AppRuntimeSyncClient) (err error) {
defaultV2Manager, err = NewAPIManager(statusCli)
return err
}
func GetManager() V2Manager {
return defaultV2Manager
}
func NewAPIManager(statusCli *client.AppRuntimeSyncClient) (*V2Routes, error) {
var v2r V2Routes
v2r.TenantStruct.StatusCli = statusCli
v2r.TenantStruct.MQClient = mq.Default().MqClient
v2r.GatewayStruct.MQClient = mq.Default().MqClient
eventServerProxy := proxy.CreateProxy("eventlog", "http", []string{"local=>rbd-eventlog:6363"})
v2r.EventLogStruct.EventlogServerProxy = eventServerProxy
return &v2r, nil
}