package slowlog_explorer

import (
	"github.com/pingcap-inc/clinic/pkg/config"
	"github.com/pingcap-inc/clinic/pkg/rbac"
)

// Service is the slow-log-explorer backend service.
type Service struct {
	rbac           rbac.Auth
	DataProxyAddr  string
	DataProxyToken string
}

// NewService creates a new slow-log-explorer service.
// Injected by fx from the main config.
func NewService(cfg *config.Config, rbac rbac.Auth) *Service {
	return &Service{
		rbac:           rbac,
		DataProxyAddr:  cfg.DataServiceConfig.GetAddr(),
		DataProxyToken: cfg.DataServiceConfig.Token,
	}
}
