refactor: clean code

This commit is contained in:
Fu Diwei
2025-01-05 03:34:46 +08:00
parent 7cf96d7d7e
commit 8af5235e4d
9 changed files with 214 additions and 218 deletions

View File

@@ -15,14 +15,14 @@ type DeployerOption struct {
AccessConfig string `json:"accessConfig"`
AccessRecord *domain.Access `json:"-"`
DeployConfig domain.DeployConfig `json:"deployConfig"`
Certificate applicant.Certificate `json:"certificate"`
Certificate applicant.ApplyResult `json:"certificate"`
}
type Deployer interface {
Deploy(ctx context.Context) error
}
func GetWithProviderAndOption(provider string, option *DeployerOption) (Deployer, error) {
func NewWithProviderAndOption(provider string, option *DeployerOption) (Deployer, error) {
deployer, logger, err := createDeployer(domain.DeployProviderType(provider), option.AccessRecord.Config, option.DeployConfig.NodeConfig)
if err != nil {
return nil, err