feat: backend native executor implement

This commit is contained in:
2026-08-16 01:27:30 +08:00
parent fbce91d797
commit 390e0565d3
44 changed files with 6430 additions and 31 deletions
+58
View File
@@ -0,0 +1,58 @@
package backendupdate
import "yms-daemon/internal/filestore"
type updateInput struct {
IdempotencyKey string
InputType string
SourcePath string
SourceSHA256 string
CustomerCode string
VersionID string
ArtifactID int64
ArtifactFileName string
ArtifactIdentity filestore.Identity
ReleasePath string
Materialize func(string) error
}
type persistedRequest struct {
InputType string `json:"inputType"`
SourcePath string `json:"sourcePath"`
SourceSHA256 string `json:"sourceSHA256"`
CustomerCode string `json:"customerCode,omitempty"`
VersionID string `json:"versionId,omitempty"`
ArtifactID int64 `json:"artifactId,omitempty"`
ArtifactFileName string `json:"artifactFileName"`
ArtifactPath string `json:"artifactPath"`
ArtifactIdentity filestore.Identity `json:"artifactIdentity"`
ReleasePath string `json:"releasePath"`
TargetPort int `json:"targetPort"`
TargetUnit string `json:"targetUnit"`
TargetSlotJAR string `json:"targetSlotJar"`
TargetHealthEndpoint string `json:"targetHealthEndpoint"`
PreviousSlotTarget string `json:"previousSlotTarget"`
PreviousGatewayPort int `json:"previousGatewayPort"`
PreviousUnit string `json:"previousUnit"`
GatewayBeforePath string `json:"gatewayBeforePath"`
GatewayAfterPath string `json:"gatewayAfterPath"`
GatewayReceiptPath string `json:"gatewayReceiptPath"`
ActiveJARPath string `json:"activeJarPath"`
ActiveJARBefore pathState `json:"activeJarBefore"`
}
type pathKind string
const (
pathKindAbsent pathKind = "absent"
pathKindRegular pathKind = "regular"
pathKindSymlink pathKind = "symlink"
)
type pathState struct {
Kind pathKind `json:"kind"`
Target string `json:"target,omitempty"`
BackupPath string `json:"backupPath,omitempty"`
Identity filestore.Identity `json:"identity,omitempty"`
Mode uint32 `json:"mode,omitempty"`
}