feat: backend executor implement

This commit is contained in:
2026-08-16 17:12:06 +08:00
parent 390e0565d3
commit 7755da72e7
31 changed files with 2762 additions and 184 deletions
+11
View File
@@ -20,6 +20,17 @@ func Update(ctx context.Context, socketPath string, service string, inputType st
return submit(ctx, socketPath, request, progress)
}
func UpdateContainerImage(ctx context.Context, socketPath string, service string, imageReference string, progress func(daemonapi.Response)) (daemonapi.Response, error) {
if !filepath.IsAbs(socketPath) {
return daemonapi.Response{}, errors.New("daemon socket path must be absolute")
}
if imageReference == "" {
return daemonapi.Response{}, errors.New("container image reference is required")
}
request := daemonapi.Request{Operation: daemonapi.OperationUpdate, Service: service, InputType: daemonapi.InputTypeContainerImage, ImageReference: imageReference}
return submit(ctx, socketPath, request, progress)
}
func Restart(ctx context.Context, socketPath string, service string, progress func(daemonapi.Response)) (daemonapi.Response, error) {
if !filepath.IsAbs(socketPath) {
return daemonapi.Response{}, errors.New("daemon socket path must be absolute")