updater

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAcceptedAlgorithms

func WithAcceptedAlgorithms(acceptedAlgorithms []string) func(*Client)

WithAcceptedAlgorithms allows to restrict the set of accepted algorithms which are used to build a delta.

func WithDockerConfigPath

func WithDockerConfigPath(dockerConfigPath string) func(*Client)

WithDockerConfigPath adds a path to a docker config file to the client configuration. The file is used to load locally stored registry credentials.

func WithInternalDirectory

func WithInternalDirectory(internalDirectory string) func(*Client)

WithInternalDirectory sets the client configurations local working directory. It stores things such as the updaters internal state.

func WithOutputDirectory

func WithOutputDirectory(outputDirectory string) func(*Client)

WithOutputDirectory adds a directory to which output files are written.

func WithRemoteURL

func WithRemoteURL(remoteURL string) func(*Client)

WithRemoteURL adds the URL of a Doras server to the client configuration.

Types

type Client

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

Client is used to run delta updates in Doras.

func NewClient

func NewClient(options ...func(*Client)) (*Client, error)

NewClient creates a new Doras update client with the provided options.

func (*Client) Pull

func (c *Client) Pull(image string) error

Pull an image from the registry.

func (*Client) PullAsync

func (c *Client) PullAsync(target string) (exists bool, err error)

PullAsync Pull delta, but do not block if the delta has not been created yet. The result of the pull is according to the client configuration.

type DorasState

type DorasState interface {
	// GetCurrentImage returns the current OCI image that is in use/rolled out.
	GetCurrentImage() (string, error)
	// SetCurrentImage to the new OCI image that is from now in use/rolled out.
	SetCurrentImage(image string) error
}

DorasState is an interface that can be used to get/set the internal state of a Doras update client.

type Patcher

type Patcher interface {
	// PatchFile located at the path  with the provided delta.
	PatchFile(fPath string, delta io.Reader) error
	// PatchDirectory located at the path with the provided delta.
	PatchDirectory(fPath string, delta io.Reader)
}

Patcher handles patching files or directories for provided deltas.

type RegistryDelegate

type RegistryDelegate interface {
	ResolveAndLoad(image string) (v1.Manifest, io.ReadCloser, error)
}

RegistryDelegate is used to load artifacts from a registry. This should handle partial downloads if possible.

Jump to

Keyboard shortcuts

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