Documentation ¶
Index ¶
- func FetchComponentReferences(cv ocm.ComponentVersionAccess, components []string) (map[string]compdesc.ComponentReference, error)
- func FetchLatestComponentVersion(repo ocm.Repository, name string) (ocm.ComponentVersionAccess, error)
- func MakeOCIRepository(octx ocm.Context, repositoryURL string) (ocm.Repository, error)
- func MakeRepositoryWithDockerConfig(octx ocm.Context, repositoryURL, dockerconfigPath string) (ocm.Repository, error)
- func RepositoryFromCTF(path string) (ocm.Repository, error)
- func Transfer(octx ocm.Context, repo, target ocm.Repository, writer io.Writer) (rerr error)
- type CTF
- type Component
- type ComponentOption
- func WithLabels(labels metav1.Labels) ComponentOption
- func WithProvider(provider string) ComponentOption
- func WithProviderLabels(labels metav1.Labels) ComponentOption
- func WithRepositoryURL(repositoryURL string) ComponentOption
- func WithToken(token string) ComponentOption
- func WithUsername(username string) ComponentOption
- type ResourceOption
- func WithComponentName(component string) ResourceOption
- func WithResourceImage(image string) ResourceOption
- func WithResourceInputType(typ string) ResourceOption
- func WithResourceName(name string) ResourceOption
- func WithResourcePath(path string) ResourceOption
- func WithResourceType(typ string) ResourceOption
- func WithResourceVersion(version string) ResourceOption
- func WithSkipVerify(skip bool) ResourceOption
- type ResourceOptions
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 ¶
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)
Types ¶
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
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.