common

package
v0.0.0-...-8705ae5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDependencyDefinitionTemplates

func GetDependencyDefinitionTemplates(parentTemplate *template.Template, packageDir string) ([]*template.Template, error)

GetDependencyDefinitionTemplates returns the templates for all dependency definition templates in a template package.

func GetExecutableTemplates

func GetExecutableTemplates(parentTemplate *template.Template, packageDir string) ([]*template.Template, error)

GetExecutableTemplates returns all executable templates in a template package.

func GetHighestPackageVersion

func GetHighestPackageVersion(kpmHomeDir string, packageName string) (string, error)

GetHighestPackageVersion returns the highest available package version found in the local KPM repository.

func GetOutputFriendlyName

func GetOutputFriendlyName(outputName string, packageFullName string) string

GetOutputFriendlyName returns the friendly name given an output name and a package's full name.

func GetPackageFullNamesFromLocalRepository

func GetPackageFullNamesFromLocalRepository(kpmHomeDir string) ([]string, error)

GetPackageFullNamesFromLocalRepository returns the list of package names in the local KPM package repository, in alphabetical order.

func GetPackageInfo

func GetPackageInfo(kpmHomeDir string, packageDir string) (*types.PackageInfo, error)

GetPackageInfo validates the package directory and returns the package info object for a given package.

func GetPackageParameters

func GetPackageParameters(parametersFile string) (*types.GenericMap, error)

GetPackageParameters returns the parameters in a file as an object which can be used as input to the interface template in a package.

func GetSharedTemplate

func GetSharedTemplate(packageDir string) (*template.Template, error)

GetSharedTemplate creates a template which contains default options, functions and helper template definitions defined in the given package.

func GetTemplateInput

func GetTemplateInput(kpmHomeDir string, packageFullName string, parentTemplate *template.Template, parameters *types.GenericMap) (*types.GenericMap, error)

GetTemplateInput creates the input values for a template by combining the interface, parameters and package info.

func PullPackage

func PullPackage(kpmHomeDir string, dockerRegistry string, packageName string, packageVersion string) error

PullPackage retrieves a remote template package and makes it available for use.

Types

type DependencyTree

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

DependencyTree is the definition of the package dependency tree.

func GetDependencyTree

func GetDependencyTree(kpmHomeDir string, packageName string, packageVersion string, dockerRegistry string, outputName string, parameters *types.GenericMap) (*DependencyTree, error)

GetDependencyTree ensures that the dependency tree has no loops and then returns the dependency tree.

func (*DependencyTree) VisitNodesDepthFirst

func (tree *DependencyTree) VisitNodesDepthFirst(consumeNode func(relativeFilePath []string, friendlyNamePath []string, executableTemplates []*template.Template, templateInput *types.GenericMap) error) (int, error)

VisitNodesDepthFirst visits nodes in the tree in depth-first fashion, applying the given consumer function on each node. It returns the number of nodes that were visited.

type PackageNamesAndVersions

type PackageNamesAndVersions map[string][]string

PackageNamesAndVersions is the mapping of package names to its list of versions.

func GetAvailablePackagesAndVersions

func GetAvailablePackagesAndVersions(kpmHomeDir string) (PackageNamesAndVersions, error)

GetAvailablePackagesAndVersions retrieves the list of available packages and their versions.

Jump to

Keyboard shortcuts

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