ocm

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchComponentReferences

func FetchComponentReferences(cv ocm.ComponentVersionAccess, components []string) (map[string]compdesc.ComponentReference, error)

FetchComponentReferences fetches the component references from the given component version.

func FetchLatestComponentVersion

func FetchLatestComponentVersion(repo ocm.Repository, name string) (ocm.ComponentVersionAccess, error)

FetchLatestComponentVersion fetches the latest version of the component with the given name. It returns the component version access and an error if the component version cannot be fetched.

func MakeOCIRepository

func MakeOCIRepository(octx ocm.Context, repositoryURL string) (ocm.Repository, error)

MakeOCIRepository creates a repository for the given repositoryURL.

func MakeRepositoryWithDockerConfig

func MakeRepositoryWithDockerConfig(octx ocm.Context, repositoryURL, dockerconfigPath string) (ocm.Repository, error)

MakeRepositoryWithDockerConfig creates a repository, and use tge given dockerconfigPath to configure the credentials.

func RepositoryFromCTF

func RepositoryFromCTF(path string) (ocm.Repository, error)

func Transfer

func Transfer(octx ocm.Context, repo, target ocm.Repository, writer io.Writer) (rerr error)

Transfer transfers a component to a repository. It accepts a target corresponding to the repository.

Types

type CTF

type CTF ocm.Repository

CTF is a component transfer format repository.

func CreateCTF

func CreateCTF(ctx ocm.Context, repoPath string, opts ...accessio.Option) (CTF, error)

CreateCTF creates a new ctf repository.

type Component

type Component struct {
	// Context is the context used for creating the component.
	Context ocm.Context
	// Name is the name of the component.
	Name string
	// Version is the version of the component.
	Version string
	// contains filtered or unexported fields
}

Component contains the information for managing a component. It is used to create a component archive, add resources and transfer the component to a repository.

func NewComponent

func NewComponent(ctx ocm.Context, name, version string, opts ...ComponentOption) (*Component, error)

NewComponent creates a new component.

func (*Component) AddResource

func (c *Component) AddResource(opts ...ResourceOption) (rerr error)

AddResource adds a resource to a component archive. It accepts options for configuring the resource. The resource type can be one of the following: - file - ociImage - componentReference

func (*Component) AddToCTF

func (c *Component) AddToCTF(repo ocm.Repository) (rerr error)

AddToCTF adds a component to a ctf repository.

func (*Component) Close

func (c *Component) Close() error

Close closes the component access.

type ComponentOption

type ComponentOption func(*options)

ComponentOption is a function that configures a component options.

func WithLabels

func WithLabels(labels metav1.Labels) ComponentOption

WithLabels configures the labels of the component.

func WithProvider

func WithProvider(provider string) ComponentOption

WithProvider configures the provider of the component.

func WithProviderLabels

func WithProviderLabels(labels metav1.Labels) ComponentOption

WithProviderLabels configures the provider labels of the component.

func WithRepositoryURL

func WithRepositoryURL(repositoryURL string) ComponentOption

WithRepositoryURL configures the repository url of the component.

func WithToken

func WithToken(token string) ComponentOption

WithToken configures the token of the component.

func WithUsername

func WithUsername(username string) ComponentOption

WithUsername configures the username of the component.

type ResourceOption

type ResourceOption func(*ResourceOptions)

ResourceOption is a function that configures a resource options.

func WithComponentName

func WithComponentName(component string) ResourceOption

WithComponentName configures the component name of the resource to be added.

func WithResourceImage

func WithResourceImage(image string) ResourceOption

WithResourceImage configures the image of the resource.

func WithResourceInputType

func WithResourceInputType(typ string) ResourceOption

WithResourceInputType configures the input type of the resource.

func WithResourceName

func WithResourceName(name string) ResourceOption

WithResourceName configures the name of the resource.

func WithResourcePath

func WithResourcePath(path string) ResourceOption

WithResourcePath configures the path of the resource.

func WithResourceType

func WithResourceType(typ string) ResourceOption

WithResourceType configures the type of the resource.

func WithResourceVersion

func WithResourceVersion(version string) ResourceOption

WithResourceVersion configures the version of the resource.

func WithSkipVerify added in v0.4.0

func WithSkipVerify(skip bool) ResourceOption

WithSkipVerify adds an option to skip the digest calculation of this resource.

type ResourceOptions

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

ResourceOptions contains the options for adding a resource to a component archive.

Jump to

Keyboard shortcuts

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