mirror of
https://github.com/certimate-go/certimate.git
synced 2026-06-22 21:05:48 +08:00
28 lines
921 B
Go
28 lines
921 B
Go
package deployers
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/certimate-go/certimate/internal/domain"
|
|
"github.com/certimate-go/certimate/pkg/core"
|
|
ctcccloudcms "github.com/certimate-go/certimate/pkg/core/ssl-deployer/providers/ctcccloud-cms"
|
|
xmaps "github.com/certimate-go/certimate/pkg/utils/maps"
|
|
)
|
|
|
|
func init() {
|
|
if err := Registries.Register(domain.DeploymentProviderTypeCTCCCloudCMS, func(options *ProviderFactoryOptions) (core.SSLDeployer, error) {
|
|
credentials := domain.AccessConfigForCTCCCloud{}
|
|
if err := xmaps.Populate(options.ProviderAccessConfig, &credentials); err != nil {
|
|
return nil, fmt.Errorf("failed to populate provider access config: %w", err)
|
|
}
|
|
|
|
provider, err := ctcccloudcms.NewSSLDeployerProvider(&ctcccloudcms.SSLDeployerProviderConfig{
|
|
AccessKeyId: credentials.AccessKeyId,
|
|
SecretAccessKey: credentials.SecretAccessKey,
|
|
})
|
|
return provider, err
|
|
}); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|