mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-12-31 11:09:07 +08:00
Introduce a client interface, to abstract from buildkit client.
This will allow further enhancement like caching remote driver responses. Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
This commit is contained in:
20
driver/client.go
Normal file
20
driver/client.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package driver
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
controlapi "github.com/moby/buildkit/api/services/control"
|
||||
"github.com/moby/buildkit/client"
|
||||
gateway "github.com/moby/buildkit/frontend/gateway/client"
|
||||
)
|
||||
|
||||
type Client interface {
|
||||
Build(ctx context.Context, opt client.SolveOpt, product string, buildFunc gateway.BuildFunc, statusChan chan *client.SolveStatus) (*client.SolveResponse, error)
|
||||
ListWorkers(ctx context.Context, opts ...client.ListWorkersOption) ([]*client.WorkerInfo, error)
|
||||
Info(ctx context.Context) (*client.Info, error)
|
||||
DiskUsage(ctx context.Context, opts ...client.DiskUsageOption) ([]*client.UsageInfo, error)
|
||||
Prune(ctx context.Context, ch chan client.UsageInfo, opts ...client.PruneOption) error
|
||||
ControlClient() controlapi.ControlClient
|
||||
Close() error
|
||||
Wait(ctx context.Context) error
|
||||
}
|
||||
Reference in New Issue
Block a user