manager

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToV1alpha1

func ConvertToV1alpha1(in metav1.Dependency) metav1alpha1.Dependency

ConvertToV1alpha1 converts v1.Dependency types to v1alpha1.Dependency types.

func ConvertToV1beta1

func ConvertToV1beta1(in metav1.Dependency) v1beta1.Dependency

ConvertToV1beta1 converts v1.Dependency types to v1beta1.Dependency types.

Types

type Cache

type Cache interface {
	Get(v1beta1.Dependency) (*xpkg.ParsedPackage, error)
	Store(v1beta1.Dependency, *xpkg.ParsedPackage) error
	Versions(v1beta1.Dependency) ([]string, error)
	Watch() <-chan cache.Event
}

Cache defines the API contract for working with a Cache.

type ImageResolver

type ImageResolver interface {
	ResolveDigest(context.Context, v1beta1.Dependency) (string, error)
	ResolveImage(context.Context, v1beta1.Dependency) (string, v1.Image, error)
	ResolveTag(context.Context, v1beta1.Dependency) (string, error)
}

ImageResolver defines the API contract for working with an ImageResolver.

type Manager

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

Manager defines a dependency Manager

func New

func New(opts ...Option) (*Manager, error)

New returns a new Manager

func (*Manager) AddAll

AddAll resolves the given package as well as it's transitive dependencies. If storage is successful, the resolved dependency is returned, errors otherwise.

func (*Manager) Resolve

Resolve resolves the given package as well as it's transitive dependencies. If dependencies are not included in the current cache, an error is returned.

func (*Manager) Versions

func (m *Manager) Versions(ctx context.Context, d v1beta1.Dependency) ([]string, error)

Versions returns the dependency versions corresponding to the supplied v1beta1.Dependency that currently exist locally.

func (*Manager) View

func (m *Manager) View(ctx context.Context, deps []v1beta1.Dependency) (*View, error)

View returns a View corresponding to the supplied dependency slice (both defined and transitive).

func (*Manager) Watch

func (m *Manager) Watch() <-chan cache.Event

Watch provides a hook for watching changes coming from the cache.

type Option

type Option func(*Manager)

Option modifies the Manager.

func WithCache

func WithCache(c Cache) Option

WithCache sets the supplied cache.Local on the Manager.

func WithLogger

func WithLogger(l logging.Logger) Option

WithLogger overrides the default logger with the supplied logger.

func WithResolver

func WithResolver(r ImageResolver) Option

WithResolver sets the supplied dep.Resolver on the Manager.

func WithWatchInterval

func WithWatchInterval(i *time.Duration) Option

WithWatchInterval overrides the default watch interval for the Manager.

type View

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

View represents the processed View corresponding to some dependencies.

func (*View) Packages

func (v *View) Packages() map[string]*xpkg.ParsedPackage

Packages returns the packages map for the view.

type XpkgMarshaler

type XpkgMarshaler interface {
	FromImage(ixpkg.Image) (*xpkg.ParsedPackage, error)
	FromDir(afero.Fs, string) (*xpkg.ParsedPackage, error)
}

XpkgMarshaler defines the API contract for working with an xpkg.ParsedPackage marshaler.

Jump to

Keyboard shortcuts

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