updatecmd

package
v1.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = Update{
	LoadPackage: func(ctx context.Context, target string) (*packagecontent.Package, error) {
		var filemap packagecontent.Files

		filemap, err := packageimport.Folder(ctx, target)
		if err != nil {
			return nil, err
		}

		pkg, err := packageloader.New(cmdutil.Scheme).FromFiles(ctx, filemap)
		if err != nil {
			return nil, err
		}

		return pkg, nil
	},
	RetrieveDigest: crane.Digest,
	WriteLockFile: func(path string, data []byte) error {
		return os.WriteFile(path, data, 0o644)
	},
}

Functions

This section is empty.

Types

type Update

type Update struct {
	LoadPackage    func(ctx context.Context, target string) (*packagecontent.Package, error)
	RetrieveDigest func(ref string, opt ...crane.Option) (string, error)
	WriteLockFile  func(path string, data []byte) error
	Target         string
}

func (*Update) CobraCommand

func (u *Update) CobraCommand() *cobra.Command

func (*Update) Complete

func (u *Update) Complete(args []string) (err error)

func (Update) Run

func (u Update) Run(ctx context.Context) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL