21 lines
438 B
Go
21 lines
438 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"mstore/pkg/client"
|
|
)
|
|
|
|
func (util *ImageUtil) pushImage(params *PushImageParams) (*PushImageResult, error) {
|
|
var err error
|
|
ctx := context.Background()
|
|
res := &PushImageResult{}
|
|
|
|
cli := client.NewClientWithAuth(params.Username, params.Password)
|
|
timeout := time.Duration(params.Timeout) * time.Second
|
|
err = cli.PushImage(ctx, params.Filepath, params.Imagepath, timeout)
|
|
|
|
return res, err
|
|
}
|