22 lines
439 B
Go
22 lines
439 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"mstore/pkg/client"
|
|
)
|
|
|
|
func (util *ImageUtil) pullImage(params *PullImageParams) (*PullImageResult, error) {
|
|
var err error
|
|
|
|
ctx := context.Background()
|
|
res := &PullImageResult{}
|
|
|
|
cli := client.NewClientWithAuth(params.Username, params.Password)
|
|
timeout := time.Duration(params.Timeout) * time.Second
|
|
err = cli.PullImage(ctx, params.Imagepath, params.Filepath, timeout)
|
|
|
|
return res, err
|
|
}
|