pack

package
v0.6.4-113-g6e780b4 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: BSD-3-Clause Imports: 4 Imported by: 1

Documentation

Overview

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextKey

type ContextKey string

type Package

type Package interface {
	unikraft.Nameable

	// Metadata returns any additional metadata associated with this package.
	Metadata() any

	// Push the package to a remotely retrievable destination.
	Push(context.Context, ...PushOption) error

	// Pull retreives the package from a remotely retrievable location.
	Pull(context.Context, ...PullOption) error

	// Format returns the name of the implementation.
	Format() PackageFormat
}

type PackageFormat added in v0.5.0

type PackageFormat string

func (PackageFormat) String added in v0.5.0

func (pf PackageFormat) String() string

type PullOption added in v0.4.0

type PullOption func(opts *PullOptions) error

PullOption is an option function which is used to modify PullOptions.

func WithPullArchitecture

func WithPullArchitecture(arch string) PullOption

WithPullArchitecture requests a given architecture (if applicable)

func WithPullAuthConfig added in v0.6.0

func WithPullAuthConfig(auth map[string]config.AuthConfig) PullOption

WithPullAuthConfig sets the authentication config to use when pulling the package.

func WithPullCache

func WithPullCache(cache bool) PullOption

WithPullCache to set whether use cache if possible.

func WithPullChecksum

func WithPullChecksum(calc bool) PullOption

WithPullChecksum to set whether to calculate and compare the checksum of the package.

func WithPullPlatform

func WithPullPlatform(plat string) PullOption

WithPullPlatform requests a given platform (if applicable).

func WithPullProgressFunc

func WithPullProgressFunc(onProgress func(progress float64)) PullOption

WithPullProgressFunc set an optional progress function which is used as a callback during the transmission of the package and the host.

func WithPullVersion added in v0.4.0

func WithPullVersion(version string) PullOption

WithPullVersion sets the version that should be pulled.

func WithPullWorkdir

func WithPullWorkdir(workdir string) PullOption

WithPullWorkdir set the working directory context of the pull such that the resources of the package are placed there appropriately.

type PullOptions added in v0.4.0

type PullOptions struct {
	// contains filtered or unexported fields
}

PullOptions contains the list of options which can be set for pulling a package.

func NewPullOptions added in v0.4.0

func NewPullOptions(opts ...PullOption) (*PullOptions, error)

NewPullOptions creates PullOptions

func (*PullOptions) Architecture added in v0.6.0

func (ppo *PullOptions) Architecture() string

Architecture to pull.

func (*PullOptions) Auths added in v0.6.0

func (ppo *PullOptions) Auths(domain string) *config.AuthConfig

Auths returns the set authentication config for a given domain or nil if the domain was not found.

func (*PullOptions) CalculateChecksum added in v0.4.0

func (ppo *PullOptions) CalculateChecksum() bool

CalculateChecksum returns whether the pull request should perform a check of the resource sum.

func (*PullOptions) OnProgress added in v0.4.0

func (ppo *PullOptions) OnProgress(progress float64)

OnProgress calls (if set) an embedded progress function which can be used to update an external progress bar, for example.

func (*PullOptions) Platform added in v0.6.0

func (ppo *PullOptions) Platform() string

Platform to pull.

func (*PullOptions) UseCache added in v0.4.0

func (ppo *PullOptions) UseCache() bool

UseCache returns whether the pull should redirect to using a local cache if available.

func (*PullOptions) Version added in v0.4.0

func (ppo *PullOptions) Version() string

Version returns

func (*PullOptions) Workdir added in v0.4.0

func (ppo *PullOptions) Workdir() string

Workdir returns the set working directory as part of the pull request

type PushOption added in v0.4.0

type PushOption func(*PushOptions) error

PushOption is an option function which is used to modify PushOptions.

func WithPushProgressFunc added in v0.6.0

func WithPushProgressFunc(onProgress func(progress float64)) PushOption

WithPushProgressFunc set an optional progress function which is used as a callback during the transmission of the package and the host.

type PushOptions added in v0.4.0

type PushOptions struct {
	// contains filtered or unexported fields
}

PushOptions contains the list of options which can be set whilst pushing a package.

func NewPushOptions added in v0.6.0

func NewPushOptions(opts ...PushOption) (*PushOptions, error)

NewPushOptions creates PushOptions

Jump to

Keyboard shortcuts

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