mirror of
https://github.com/usual2970/certimate.git
synced 2025-09-19 14:36:01 +00:00
add deploy info
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user