github.com/pdmccormick/importable-docker-buildx@v0.0.0-20240426161518-e47091289030/controller/control/controller.go (about) 1 package control 2 3 import ( 4 "context" 5 "io" 6 7 controllerapi "github.com/docker/buildx/controller/pb" 8 "github.com/docker/buildx/util/progress" 9 "github.com/moby/buildkit/client" 10 ) 11 12 type BuildxController interface { 13 Build(ctx context.Context, options controllerapi.BuildOptions, in io.ReadCloser, progress progress.Writer) (ref string, resp *client.SolveResponse, err error) 14 // Invoke starts an IO session into the specified process. 15 // If pid doesn't matche to any running processes, it starts a new process with the specified config. 16 // If there is no container running or InvokeConfig.Rollback is speicfied, the process will start in a newly created container. 17 // NOTE: If needed, in the future, we can split this API into three APIs (NewContainer, NewProcess and Attach). 18 Invoke(ctx context.Context, ref, pid string, options controllerapi.InvokeConfig, ioIn io.ReadCloser, ioOut io.WriteCloser, ioErr io.WriteCloser) error 19 Kill(ctx context.Context) error 20 Close() error 21 List(ctx context.Context) (refs []string, _ error) 22 Disconnect(ctx context.Context, ref string) error 23 ListProcesses(ctx context.Context, ref string) (infos []*controllerapi.ProcessInfo, retErr error) 24 DisconnectProcess(ctx context.Context, ref, pid string) error 25 Inspect(ctx context.Context, ref string) (*controllerapi.InspectResponse, error) 26 } 27 28 type ControlOptions struct { 29 ServerConfig string 30 Root string 31 Detach bool 32 }