Enable to restore build options from the server

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
This commit is contained in:
Kohei Tokunaga
2023-04-15 15:38:05 +09:00
parent b3340cc7ba
commit ce48b1ae84
7 changed files with 329 additions and 142 deletions

View File

@ -74,6 +74,9 @@ func (c *Client) List(ctx context.Context) (keys []string, retErr error) {
}
func (c *Client) Disconnect(ctx context.Context, key string) error {
if key == "" {
return nil
}
_, err := c.client().Disconnect(ctx, &pb.DisconnectRequest{Ref: key})
return err
}
@ -107,6 +110,10 @@ func (c *Client) Invoke(ctx context.Context, ref string, pid string, invokeConfi
})
}
func (c *Client) Inspect(ctx context.Context, ref string) (*pb.InspectResponse, error) {
return c.client().Inspect(ctx, &pb.InspectRequest{Ref: ref})
}
func (c *Client) Build(ctx context.Context, options pb.BuildOptions, in io.ReadCloser, w io.Writer, out console.File, progressMode string) (string, *client.SolveResponse, error) {
ref := identity.NewID()
pw, err := progress.NewPrinter(context.TODO(), w, out, progressMode)