mirror of
https://github.com/usual2970/certimate.git
synced 2025-10-05 14:04:54 +00:00
feat: rename san
to subjectAltNames
, workflow
to workflowId
, nodeId
to workflowNodeId
, output
to workflowOutputId
, log
to logs
, succeed
to succeeded
This commit is contained in:
@@ -2,42 +2,25 @@ package domain
|
||||
|
||||
import "time"
|
||||
|
||||
var ValidityDuration = time.Hour * 24 * 10
|
||||
|
||||
type Certificate struct {
|
||||
Meta
|
||||
SubjectAltNames string `json:"san" db:"san"`
|
||||
Source string `json:"source" db:"source"`
|
||||
SubjectAltNames string `json:"subjectAltNames" db:"subjectAltNames"`
|
||||
Certificate string `json:"certificate" db:"certificate"`
|
||||
PrivateKey string `json:"privateKey" db:"privateKey"`
|
||||
IssuerCertificate string `json:"issuerCertificate" db:"issuerCertificate"`
|
||||
CertUrl string `json:"certUrl" db:"certUrl"`
|
||||
CertStableUrl string `json:"certStableUrl" db:"certStableUrl"`
|
||||
WorkflowId string `json:"workflow" db:"workflow"`
|
||||
WorkflowNodeId string `json:"nodeId" db:"nodeId"`
|
||||
WorkflowOutputId string `json:"output" db:"output"`
|
||||
EffectAt time.Time `json:"effectAt" db:"effectAt"`
|
||||
ExpireAt time.Time `json:"expireAt" db:"expireAt"`
|
||||
AcmeCertUrl string `json:"acmeCertUrl" db:"acmeCertUrl"`
|
||||
AcmeCertStableUrl string `json:"acmeCertStableUrl" db:"acmeCertStableUrl"`
|
||||
WorkflowId string `json:"workflowId" db:"workflowId"`
|
||||
WorkflowNodeId string `json:"workflowNodeId" db:"workflowNodeId"`
|
||||
WorkflowOutputId string `json:"workflowOutputId" db:"workflowOutputId"`
|
||||
}
|
||||
|
||||
type CertificateMeta struct {
|
||||
Version string `json:"version"`
|
||||
SerialNumber string `json:"serialNumber"`
|
||||
Validity CertificateValidity `json:"validity"`
|
||||
SignatureAlgorithm string `json:"signatureAlgorithm"`
|
||||
Issuer CertificateIssuer `json:"issuer"`
|
||||
Subject CertificateSubject `json:"subject"`
|
||||
}
|
||||
type CertificateSourceType string
|
||||
|
||||
type CertificateIssuer struct {
|
||||
Country string `json:"country"`
|
||||
Organization string `json:"organization"`
|
||||
CommonName string `json:"commonName"`
|
||||
}
|
||||
|
||||
type CertificateSubject struct {
|
||||
CN string `json:"CN"`
|
||||
}
|
||||
|
||||
type CertificateValidity struct {
|
||||
NotBefore string `json:"notBefore"`
|
||||
NotAfter string `json:"notAfter"`
|
||||
}
|
||||
const (
|
||||
CERTIFICATE_SOURCE_WORKFLOW = CertificateSourceType("workflow")
|
||||
CERTIFICATE_SOURCE_UPLOAD = CertificateSourceType("upload")
|
||||
)
|
||||
|
@@ -4,9 +4,9 @@ const WorkflowOutputCertificate = "certificate"
|
||||
|
||||
type WorkflowOutput struct {
|
||||
Meta
|
||||
Workflow string `json:"workflow"`
|
||||
NodeId string `json:"nodeId"`
|
||||
Node *WorkflowNode `json:"node"`
|
||||
Output []WorkflowNodeIO `json:"output"`
|
||||
Succeed bool `json:"succeed"`
|
||||
WorkflowId string `json:"workflowId" db:"workflowId"`
|
||||
NodeId string `json:"nodeId" db:"nodeId"`
|
||||
Node *WorkflowNode `json:"node" db:"node"`
|
||||
Outputs []WorkflowNodeIO `json:"outputs" db:"outputs"`
|
||||
Succeeded bool `json:"succeeded"db:"succeeded"`
|
||||
}
|
||||
|
@@ -1,5 +1,13 @@
|
||||
package domain
|
||||
|
||||
type WorkflowRunLog struct {
|
||||
Meta
|
||||
WorkflowId string `json:"workflowId" db:"workflowId"`
|
||||
Logs []RunLog `json:"logs" db:"logs"`
|
||||
Succeeded bool `json:"succeeded" db:"succeeded"`
|
||||
Error string `json:"error" db:"error"`
|
||||
}
|
||||
|
||||
type RunLogOutput struct {
|
||||
Time string `json:"time"`
|
||||
Title string `json:"title"`
|
||||
@@ -8,19 +16,12 @@ type RunLogOutput struct {
|
||||
}
|
||||
|
||||
type RunLog struct {
|
||||
NodeId string `json:"nodeId"`
|
||||
NodeName string `json:"nodeName"`
|
||||
Error string `json:"error"`
|
||||
Outputs []RunLogOutput `json:"outputs"`
|
||||
}
|
||||
|
||||
type WorkflowRunLog struct {
|
||||
Meta
|
||||
Workflow string `json:"workflow"`
|
||||
Log []RunLog `json:"log"`
|
||||
Succeed bool `json:"succeed"`
|
||||
Error string `json:"error"`
|
||||
}
|
||||
|
||||
type RunLogs []RunLog
|
||||
|
||||
func (r RunLogs) Error() string {
|
||||
|
Reference in New Issue
Block a user