add deploy info

This commit is contained in:
yoan
2024-08-29 21:41:55 +08:00
parent bae35536b8
commit fb40caa25c
13 changed files with 120 additions and 25 deletions

View File

@@ -3,6 +3,7 @@ package deployer
import (
"certimate/internal/applicant"
"context"
"encoding/json"
"errors"
"strings"
@@ -31,6 +32,7 @@ type DeployerOption struct {
type Deployer interface {
Deploy(ctx context.Context) error
GetInfo() []string
}
func Get(record *models.Record, cert *applicant.Certificate) (Deployer, error) {
@@ -73,3 +75,11 @@ func getProduct(record *models.Record) string {
}
return rs[1]
}
func toStr(tag string, data any) string {
if data == nil {
return tag
}
byts, _ := json.Marshal(data)
return tag + "" + string(byts)
}