Documentation ¶
Overview ¶
Package app defines reference objects used to generate OpenShift API objects
Index ¶
- Variables
- func ContainerPortsFromString(portString string) ([]kapi.ContainerPort, error)
- func IsBuilderImage(image *imageapi.DockerImage) bool
- func IsComponentReference(s string) bool
- func IsPossibleSourceRepository(s string) bool
- func IsPossibleTemplateFile(value string) bool
- func IsRemoteRepository(s string) bool
- func JoinEnvironment(a, b []kapi.EnvVar) (out []kapi.EnvVar)
- func LabelsFromSpec(spec []string) (map[string]string, []string, error)
- func StrategyAndSourceForRepository(repo *SourceRepository, image *ImageRef) (*BuildStrategyRef, *SourceRef, error)
- type Acceptor
- type Acceptors
- type BuildRef
- type BuildStrategyRef
- type BuildStrategyRefGenerator
- type ComponentInput
- type ComponentMatch
- type ComponentReference
- type ComponentReferences
- type DeploymentConfigRef
- type Detector
- type DockerClient
- type DockerClientResolver
- type DockerRegistryResolver
- type Environment
- type ErrMultipleMatches
- type ErrNoMatch
- type Generated
- type GroupedComponentReferences
- type ImageRef
- func (r *ImageRef) BuildOutput() (*buildapi.BuildOutput, error)
- func (r *ImageRef) BuildTriggers() []buildapi.BuildTriggerPolicy
- func (r *ImageRef) DeployableContainer() (container *kapi.Container, triggers []deployapi.DeploymentTriggerPolicy, ...)
- func (r *ImageRef) ImageStream() (*imageapi.ImageStream, error)
- func (r *ImageRef) ObjectReference() kapi.ObjectReference
- func (r *ImageRef) RepoName() string
- func (r *ImageRef) SuggestName() (string, bool)
- type ImageRefGenerator
- type ImageStreamByAnnotationResolver
- type ImageStreamResolver
- type NameSuggester
- type NameSuggestions
- type Objects
- type PassThroughDockerResolver
- type PerfectMatchWeightedResolver
- type Pipeline
- type PipelineGroup
- type ReferenceBuilder
- func (r *ReferenceBuilder) AddComponents(inputs []string, fn func(*ComponentInput) ComponentReference) ComponentReferences
- func (r *ReferenceBuilder) AddGroups(inputs []string)
- func (r *ReferenceBuilder) AddSourceRepository(input string) (*SourceRepository, bool)
- func (r *ReferenceBuilder) Result() (ComponentReferences, SourceRepositories, []error)
- type Resolver
- type ScoredComponentMatches
- type Searcher
- type SourceLanguageType
- type SourceRef
- type SourceRefGenerator
- type SourceRepositories
- type SourceRepository
- func (r *SourceRepository) BuildWithDocker()
- func (r *SourceRepository) ContextDir() string
- func (r *SourceRepository) Detect(d Detector) error
- func (r *SourceRepository) InUse() bool
- func (r *SourceRepository) Info() *SourceRepositoryInfo
- func (r *SourceRepository) IsDockerBuild() bool
- func (r *SourceRepository) LocalPath() (string, error)
- func (r *SourceRepository) Remote() bool
- func (r *SourceRepository) RemoteURL() (*url.URL, error)
- func (r *SourceRepository) SetContextDir(dir string)
- func (r *SourceRepository) SetInfo(info *SourceRepositoryInfo)
- func (r *SourceRepository) String() string
- func (r *SourceRepository) UsedBy(ref ComponentReference)
- type SourceRepositoryEnumerator
- type SourceRepositoryInfo
- type TemplateFileResolver
- type TemplateResolver
- type WeightedResolver
- type WeightedResolvers
Constants ¶
This section is empty.
Variables ¶
var ErrNoLanguageDetected = fmt.Errorf("No language matched the source repository")
ErrNoLanguageDetected is the error returned when no language can be detected by all source code detectors.
Functions ¶
func ContainerPortsFromString ¶
func ContainerPortsFromString(portString string) ([]kapi.ContainerPort, error)
ContainerPortsFromString extracts sets of port specifications from a comma-delimited string. Each segment must be a single port number (container port) or a colon delimited pair of ports (container port and host port).
func IsBuilderImage ¶
func IsBuilderImage(image *imageapi.DockerImage) bool
IsBuilderImage checks whether the provided Docker image is a builder image or not
func IsComponentReference ¶
IsComponentReference returns true if the provided string appears to be a reference to a source repository on disk, at a URL, a docker image name (which might be on a Docker registry or an OpenShift image stream), or a template.
func IsPossibleSourceRepository ¶
IsPossibleSourceRepository checks whether the provided string is a source repository or not
func IsPossibleTemplateFile ¶
IsPossibleTemplateFile returns true if the argument can be a template file
func IsRemoteRepository ¶
IsRemoteRepository checks whether the provided string is a remote repository or not
func JoinEnvironment ¶
JoinEnvironment joins two different sets of environment variables into one, leaving out all the duplicates
func LabelsFromSpec ¶
LabelsFromSpec turns a set of specs NAME=VALUE or NAME- into a map of labels, a remove label list, or an error.
func StrategyAndSourceForRepository ¶
func StrategyAndSourceForRepository(repo *SourceRepository, image *ImageRef) (*BuildStrategyRef, *SourceRef, error)
StrategyAndSourceForRepository returns the build strategy and source code reference of the provided source repository TODO: user should be able to choose whether to download a remote source ref for more info
Types ¶
type Acceptor ¶
type Acceptor interface {
Accept(from interface{}) bool
}
Acceptor is an interface for accepting objects
var AcceptAll Acceptor = acceptAll{}
AcceptAll accepts all objects
var AcceptNew Acceptor = acceptNew{}
AcceptNew only accepts runtime.Objects with an empty resource version.
func NewAcceptBuildConfigs ¶
func NewAcceptBuildConfigs(typer runtime.ObjectTyper) Acceptor
NewAcceptBuildConfigs creates an acceptor accepting BuildConfig objects and ImageStreams objects.
func NewAcceptUnique ¶
func NewAcceptUnique(typer runtime.ObjectTyper) Acceptor
NewAcceptUnique creates an acceptor that only accepts unique objects by kind and name
type Acceptors ¶
type Acceptors []Acceptor
Acceptors is a list of acceptors that behave like a single acceptor. All acceptors must accept an object for it to be accepted.
type BuildRef ¶
type BuildRef struct { Source *SourceRef Input *ImageRef Strategy *BuildStrategyRef Output *ImageRef }
BuildRef is a reference to a build configuration
func (*BuildRef) BuildConfig ¶
func (r *BuildRef) BuildConfig() (*buildapi.BuildConfig, error)
BuildConfig creates a buildConfig resource from the build configuration reference
type BuildStrategyRef ¶
BuildStrategyRef is a reference to a build strategy
func (*BuildStrategyRef) BuildStrategy ¶
func (s *BuildStrategyRef) BuildStrategy() (*buildapi.BuildStrategy, []buildapi.BuildTriggerPolicy)
BuildStrategy builds an OpenShift BuildStrategy from a BuildStrategyRef
type BuildStrategyRefGenerator ¶
type BuildStrategyRefGenerator struct {
// contains filtered or unexported fields
}
BuildStrategyRefGenerator generates BuildStrategyRef
Flows for BuildStrategyRef SourceRef -> BuildStrategyRef SourceRef + Docker Context -> BuildStrategyRef Docker Context + Parent Image -> BuildStrategyRef STI Builder Image -> BuildStrategyRef
func NewBuildStrategyRefGenerator ¶
func NewBuildStrategyRefGenerator(sourceDetectors source.Detectors) *BuildStrategyRefGenerator
NewBuildStrategyRefGenerator creates a BuildStrategyRefGenerator
func (*BuildStrategyRefGenerator) FromDockerContextAndParent ¶
func (g *BuildStrategyRefGenerator) FromDockerContextAndParent(parentRef *ImageRef) (*BuildStrategyRef, error)
FromDockerContextAndParent generates a build strategy ref from a context path and parent image name
func (*BuildStrategyRefGenerator) FromSTIBuilderImage ¶
func (g *BuildStrategyRefGenerator) FromSTIBuilderImage(image *ImageRef) (*BuildStrategyRef, error)
FromSTIBuilderImage generates a build strategy from a builder image ref
type ComponentInput ¶
type ComponentInput struct { GroupID int From string Argument string Value string ExpectToBuild bool Uses *SourceRepository Match *ComponentMatch Resolver }
ComponentInput is the necessary input for creating a component
func NewComponentInput ¶
func NewComponentInput(input string) (*ComponentInput, string, error)
NewComponentInput returns a new ComponentInput by checking for image using [image]~ (to indicate builder) or [image]~[code] (builder plus code)
func (*ComponentInput) Input ¶
func (i *ComponentInput) Input() *ComponentInput
Input returns the component input
func (*ComponentInput) NeedsSource ¶
func (i *ComponentInput) NeedsSource() bool
NeedsSource indicates if the component input needs source code
func (*ComponentInput) Resolve ¶
func (i *ComponentInput) Resolve() error
Resolve sets the match in input
func (*ComponentInput) String ¶
func (i *ComponentInput) String() string
func (*ComponentInput) Use ¶
func (i *ComponentInput) Use(repo *SourceRepository)
Use adds the provided source repository as the used one by the component input
type ComponentMatch ¶
type ComponentMatch struct { Value string Argument string Name string Description string Score float32 Insecure bool Builder bool Image *imageapi.DockerImage ImageStream *imageapi.ImageStream ImageTag string Template *templateapi.Template }
ComponentMatch is a match to a provided component
func (*ComponentMatch) IsImage ¶
func (m *ComponentMatch) IsImage() bool
IsImage returns whether or not the component match is an image or image stream
func (*ComponentMatch) IsTemplate ¶
func (m *ComponentMatch) IsTemplate() bool
IsTemplate returns whether or not the component match is a template
func (*ComponentMatch) String ¶
func (m *ComponentMatch) String() string
type ComponentReference ¶
type ComponentReference interface { // Input contains the input of the component Input() *ComponentInput // Resolve sets the match in input Resolve() error // NeedsSource indicates if the component needs source code NeedsSource() bool }
ComponentReference defines an interface for components
type ComponentReferences ¶
type ComponentReferences []ComponentReference
ComponentReferences is a set of components
func (ComponentReferences) Group ¶
func (r ComponentReferences) Group() (refs []ComponentReferences)
Group groups components based on their group ids
func (ComponentReferences) NeedsSource ¶
func (r ComponentReferences) NeedsSource() (refs ComponentReferences)
NeedsSource returns all the components that need source code in order to build
func (ComponentReferences) String ¶
func (r ComponentReferences) String() string
type DeploymentConfigRef ¶
type DeploymentConfigRef struct { Name string Images []*ImageRef Env Environment }
DeploymentConfigRef is a reference to a deployment configuration
func (*DeploymentConfigRef) DeploymentConfig ¶
func (r *DeploymentConfigRef) DeploymentConfig() (*deployapi.DeploymentConfig, error)
DeploymentConfig creates a deploymentConfig resource from the deployment configuration reference
TODO: take a pod template spec as argument
type Detector ¶
type Detector interface {
Detect(dir string) (*SourceRepositoryInfo, error)
}
Detector is an interface for detecting information about a source repository
type DockerClient ¶
type DockerClient interface { ListImages(opts docker.ListImagesOptions) ([]docker.APIImages, error) InspectImage(name string) (*docker.Image, error) }
DockerClient is the local interface for the docker client
type DockerClientResolver ¶
type DockerClientResolver struct { Client DockerClient // Optional, will delegate resolution to the registry if no local // exact matches are found. RegistryResolver Resolver // Insecure, if true will add an annotation to generated ImageStream // so that the image can be pulled properly Insecure bool }
DockerClientResolver finds local docker images locally that match a search value
func (DockerClientResolver) Resolve ¶
func (r DockerClientResolver) Resolve(value string) (*ComponentMatch, error)
Resolve searches all images in local docker server for an image that matches the passed in value
type DockerRegistryResolver ¶
type DockerRegistryResolver struct { Client dockerregistry.Client AllowInsecure bool }
DockerRegistryResolver searches for images in a given docker registry
func (DockerRegistryResolver) Resolve ¶
func (r DockerRegistryResolver) Resolve(value string) (*ComponentMatch, error)
Resolve searches the docker registry for repositories matching the passed in value
type Environment ¶
Environment holds environment variables for new-app
func NewEnvironment ¶
func NewEnvironment(envs ...map[string]string) Environment
NewEnvironment returns a new set of environment variables based on all the provided environment variables
func (Environment) List ¶
func (e Environment) List() []kapi.EnvVar
List sorts and returns all the environment variables
type ErrMultipleMatches ¶
type ErrMultipleMatches struct { Image string Matches []*ComponentMatch }
ErrMultipleMatches is an error returned to new-app users when multiple matches are found for a given component
func (ErrMultipleMatches) Error ¶
func (e ErrMultipleMatches) Error() string
func (ErrMultipleMatches) UsageError ¶
func (e ErrMultipleMatches) UsageError(commandName string) string
UsageError is the usage error message returned when multiple matches are found
type ErrNoMatch ¶
type ErrNoMatch struct {
// contains filtered or unexported fields
}
ErrNoMatch is an error returned to new-app users when no match is found for a given component
func (ErrNoMatch) Error ¶
func (e ErrNoMatch) Error() string
func (ErrNoMatch) UsageError ¶
func (e ErrNoMatch) UsageError(commandName string) string
UsageError is the usage error message returned when no match is found
type GroupedComponentReferences ¶
type GroupedComponentReferences ComponentReferences
GroupedComponentReferences is a set of components that can be grouped by their group id
func (GroupedComponentReferences) Len ¶
func (m GroupedComponentReferences) Len() int
func (GroupedComponentReferences) Less ¶
func (m GroupedComponentReferences) Less(i, j int) bool
func (GroupedComponentReferences) Swap ¶
func (m GroupedComponentReferences) Swap(i, j int)
type ImageRef ¶
type ImageRef struct { imageapi.DockerImageReference AsImageStream bool OutputImage bool Insecure bool HasEmptyDir bool // ObjectName overrides the name of the ImageStream produced // but does not affect the DockerImageReference ObjectName string Stream *imageapi.ImageStream Info *imageapi.DockerImage }
ImageRef is a reference to an image
func InputImageFromMatch ¶
func InputImageFromMatch(match *ComponentMatch) (*ImageRef, error)
InputImageFromMatch returns an image reference from a component match. The component match will either be an image stream or an image.
func (*ImageRef) BuildOutput ¶
func (r *ImageRef) BuildOutput() (*buildapi.BuildOutput, error)
BuildOutput returns the BuildOutput of an image reference
func (*ImageRef) BuildTriggers ¶
func (r *ImageRef) BuildTriggers() []buildapi.BuildTriggerPolicy
BuildTriggers sets up build triggers for the base image
func (*ImageRef) DeployableContainer ¶
func (r *ImageRef) DeployableContainer() (container *kapi.Container, triggers []deployapi.DeploymentTriggerPolicy, err error)
DeployableContainer sets up a container for the image ready for deployment
func (*ImageRef) ImageStream ¶
func (r *ImageRef) ImageStream() (*imageapi.ImageStream, error)
ImageStream returns an ImageStream from an image reference
func (*ImageRef) ObjectReference ¶
func (r *ImageRef) ObjectReference() kapi.ObjectReference
ObjectReference returns an object reference from the image reference
func (*ImageRef) SuggestName ¶
SuggestName suggests a name for an image reference
type ImageRefGenerator ¶
type ImageRefGenerator interface { FromName(name string) (*ImageRef, error) FromNameAndPorts(name string, ports []string) (*ImageRef, error) FromStream(repo *imageapi.ImageStream, tag string) (*ImageRef, error) FromDockerfile(name string, dir string, context string) (*ImageRef, error) }
ImageRefGenerator is an interface for generating ImageRefs
Generators for ImageRef - Name -> ImageRef - ImageRepo + tag -> ImageRef
func NewImageRefGenerator ¶
func NewImageRefGenerator() ImageRefGenerator
NewImageRefGenerator creates a new ImageRefGenerator
type ImageStreamByAnnotationResolver ¶
type ImageStreamByAnnotationResolver struct { Client client.ImageStreamsNamespacer ImageStreamImages client.ImageStreamImagesNamespacer Namespaces []string // contains filtered or unexported fields }
ImageStreamByAnnotationResolver resolves image streams based on 'supports' annotations found in tagged images belonging to the stream
func (*ImageStreamByAnnotationResolver) Resolve ¶
func (r *ImageStreamByAnnotationResolver) Resolve(value string) (*ComponentMatch, error)
Resolve finds image stream images using their 'supports' annotation
type ImageStreamResolver ¶
type ImageStreamResolver struct { Client client.ImageStreamsNamespacer ImageStreamImages client.ImageStreamImagesNamespacer Namespaces []string }
ImageStreamResolver searches the openshift server image streams for images matching a particular name
func (ImageStreamResolver) Resolve ¶
func (r ImageStreamResolver) Resolve(value string) (*ComponentMatch, error)
Resolve will attempt to find an imagestream with a name that matches the passed in value
type NameSuggester ¶
NameSuggester is an object that can suggest a name for itself
type NameSuggestions ¶
type NameSuggestions []NameSuggester
NameSuggestions suggests names from a collection of NameSuggesters
func (NameSuggestions) SuggestName ¶
func (s NameSuggestions) SuggestName() (string, bool)
SuggestName suggests a name given a collection of NameSuggesters
type Objects ¶
Objects is a set of runtime objects
func AddServices ¶
AddServices sets up services for the provided objects
type PassThroughDockerResolver ¶ added in v1.0.1
type PassThroughDockerResolver struct{}
PassThroughDockerResolver returns a match with the value that was passed in
func (*PassThroughDockerResolver) Resolve ¶ added in v1.0.1
func (r *PassThroughDockerResolver) Resolve(value string) (*ComponentMatch, error)
Resolve always returns a match
type PerfectMatchWeightedResolver ¶
type PerfectMatchWeightedResolver []WeightedResolver
PerfectMatchWeightedResolver returns only matches from resolvers that are identified as exact (weight 0.0), and only matches from those resolvers that qualify as exact (score = 0.0). If no perfect matches exist, an ErrMultipleMatches is returned indicating the remaining candidate(s). Note that this method may resolve ErrMultipleMatches with a single match, indicating an error (no perfect match) but with only one candidate.
func (PerfectMatchWeightedResolver) Resolve ¶
func (r PerfectMatchWeightedResolver) Resolve(value string) (*ComponentMatch, error)
Resolve resolves the provided input and returns only exact matches
type Pipeline ¶
type Pipeline struct { From string InputImage *ImageRef Build *BuildRef Image *ImageRef Deployment *DeploymentConfigRef }
func NewBuildPipeline ¶
func NewBuildPipeline(from string, input *ImageRef, outputDocker bool, strategy *BuildStrategyRef, source *SourceRef) (*Pipeline, error)
NewBuildPipeline creates a new pipeline with components that are expected to be built
func NewImagePipeline ¶
NewImagePipeline creates a new pipeline with components that are not expected to be built
func (*Pipeline) NeedsDeployment ¶
func (p *Pipeline) NeedsDeployment(env Environment, name string) error
NeedsDeployment sets the pipeline for deployment
type PipelineGroup ¶
type PipelineGroup []*Pipeline
PipelineGroup is a group of Pipelines
func (PipelineGroup) Reduce ¶
func (g PipelineGroup) Reduce() error
Reduce squashes all common components from the pipelines
func (PipelineGroup) String ¶
func (g PipelineGroup) String() string
type ReferenceBuilder ¶
type ReferenceBuilder struct {
// contains filtered or unexported fields
}
ReferenceBuilder is used for building all the necessary object references for an application
func (*ReferenceBuilder) AddComponents ¶
func (r *ReferenceBuilder) AddComponents(inputs []string, fn func(*ComponentInput) ComponentReference) ComponentReferences
AddComponents turns all provided component inputs into component references
func (*ReferenceBuilder) AddGroups ¶
func (r *ReferenceBuilder) AddGroups(inputs []string)
AddGroups adds group ids to groups of components
func (*ReferenceBuilder) AddSourceRepository ¶
func (r *ReferenceBuilder) AddSourceRepository(input string) (*SourceRepository, bool)
AddSourceRepository resolves the input to an actual source repository
func (*ReferenceBuilder) Result ¶
func (r *ReferenceBuilder) Result() (ComponentReferences, SourceRepositories, []error)
Result returns the result of the config conversion to object references
type Resolver ¶
type Resolver interface {
Resolve(value string) (*ComponentMatch, error)
}
Resolver is an interface for resolving provided input to component matches. A Resolver should return ErrMultipleMatches when more than one result can be constructed as a match. It should also set the score to 0.0 if this is a perfect match, and to higher values the less adequate the match is.
func NewImageStreamByAnnotationResolver ¶
func NewImageStreamByAnnotationResolver(streamClient client.ImageStreamsNamespacer, imageClient client.ImageStreamImagesNamespacer, namespaces []string) Resolver
NewImageStreamByAnnotationResolver creates a new ImageStreamByAnnotationResolver
type ScoredComponentMatches ¶
type ScoredComponentMatches []*ComponentMatch
ScoredComponentMatches is a set of component matches grouped by score
func (ScoredComponentMatches) Exact ¶
func (m ScoredComponentMatches) Exact() []*ComponentMatch
Exact returns all the exact component matches
func (ScoredComponentMatches) Len ¶
func (m ScoredComponentMatches) Len() int
func (ScoredComponentMatches) Less ¶
func (m ScoredComponentMatches) Less(i, j int) bool
func (ScoredComponentMatches) Swap ¶
func (m ScoredComponentMatches) Swap(i, j int)
type Searcher ¶
type Searcher interface {
Search(terms []string) ([]*ComponentMatch, error)
}
Searcher will return potentially multiple matches for a set of search strings
type SourceLanguageType ¶
SourceLanguageType contains info about the type of the language a source repository is built in
func (*SourceLanguageType) Term ¶
func (t *SourceLanguageType) Term() string
Term returns a search term for the given source language type the term will be in the form of language:version
type SourceRef ¶
SourceRef is a reference to a build source
func (*SourceRef) BuildSource ¶
func (r *SourceRef) BuildSource() (*buildapi.BuildSource, []buildapi.BuildTriggerPolicy)
BuildSource returns an OpenShift BuildSource from the SourceRef
func (*SourceRef) SuggestName ¶
SuggestName returns a name derived from the source URL
type SourceRefGenerator ¶
type SourceRefGenerator struct {
// contains filtered or unexported fields
}
SourceRefGenerator generates new SourceRefs either from a URL or a Directory
Generators for SourceRef - Git URL -> SourceRef - Directory -> SourceRef
func NewSourceRefGenerator ¶
func NewSourceRefGenerator() *SourceRefGenerator
NewSourceRefGenerator creates a new SourceRefGenerator
func (*SourceRefGenerator) FromDirectory ¶
func (g *SourceRefGenerator) FromDirectory(directory string) (*SourceRef, error)
SourceRefForDirectory creates a SourceRef from a directory that contains a git repository. The URL is obtained from the origin remote branch, and the reference is taken from the currently checked out branch.
func (*SourceRefGenerator) FromGitURL ¶
func (g *SourceRefGenerator) FromGitURL(location, contextDir string) (*SourceRef, error)
SourceRefForGitURL creates a SourceRef from a Git URL. If the URL includes a hash, it is used for the SourceRef's branch reference. Otherwise, 'master' is assumed
type SourceRepositories ¶
type SourceRepositories []*SourceRepository
SourceRepositories is a list of SourceRepository objects
func (SourceRepositories) NotUsed ¶
func (rr SourceRepositories) NotUsed() SourceRepositories
NotUsed returns the list of SourceRepositories that are not used
func (SourceRepositories) String ¶
func (rr SourceRepositories) String() string
type SourceRepository ¶
type SourceRepository struct {
// contains filtered or unexported fields
}
SourceRepository represents a code repository that may be the target of a build.
func MockSourceRepositories ¶
func MockSourceRepositories() []*SourceRepository
MockSourceRepositories is a set of mocked source repositories used for testing
func NewSourceRepository ¶
func NewSourceRepository(s string) (*SourceRepository, error)
NewSourceRepository creates a reference to a local or remote source code repository from a URL or path.
func (*SourceRepository) BuildWithDocker ¶
func (r *SourceRepository) BuildWithDocker()
BuildWithDocker specifies that the source repository was built with Docker
func (*SourceRepository) ContextDir ¶
func (r *SourceRepository) ContextDir() string
ContextDir returns the context directory of the source repository
func (*SourceRepository) Detect ¶
func (r *SourceRepository) Detect(d Detector) error
Detect clones source locally if not already local and runs code detection with the given detector.
func (*SourceRepository) InUse ¶
func (r *SourceRepository) InUse() bool
InUse checks if the source repository is in use
func (*SourceRepository) Info ¶
func (r *SourceRepository) Info() *SourceRepositoryInfo
Info returns the source repository info generated on code detection
func (*SourceRepository) IsDockerBuild ¶
func (r *SourceRepository) IsDockerBuild() bool
IsDockerBuild checks if the source repository was built with Docker
func (*SourceRepository) LocalPath ¶
func (r *SourceRepository) LocalPath() (string, error)
LocalPath returns the local path of the source repository
func (*SourceRepository) Remote ¶
func (r *SourceRepository) Remote() bool
Remote checks whether the source repository is remote
func (*SourceRepository) RemoteURL ¶
func (r *SourceRepository) RemoteURL() (*url.URL, error)
RemoteURL returns the remote URL of the source repository
func (*SourceRepository) SetContextDir ¶
func (r *SourceRepository) SetContextDir(dir string)
SetContextDir sets the context directory to use for the source repository
func (*SourceRepository) SetInfo ¶ added in v1.0.1
func (r *SourceRepository) SetInfo(info *SourceRepositoryInfo)
SetInfo sets the source repository info. This is to facilitate certain tests.
func (*SourceRepository) String ¶
func (r *SourceRepository) String() string
func (*SourceRepository) UsedBy ¶
func (r *SourceRepository) UsedBy(ref ComponentReference)
UsedBy sets up which component uses the source repository
type SourceRepositoryEnumerator ¶
type SourceRepositoryEnumerator struct { Detectors source.Detectors Tester dockerfile.Tester }
SourceRepositoryEnumerator implements the Detector interface
func (SourceRepositoryEnumerator) Detect ¶
func (e SourceRepositoryEnumerator) Detect(dir string) (*SourceRepositoryInfo, error)
Detect extracts source code information about the provided source repository
type SourceRepositoryInfo ¶
type SourceRepositoryInfo struct { Path string Types []SourceLanguageType Dockerfile dockerfile.Dockerfile }
SourceRepositoryInfo contains info about a source repository
func (*SourceRepositoryInfo) Terms ¶
func (info *SourceRepositoryInfo) Terms() []string
Terms returns which languages the source repository was built with
type TemplateFileResolver ¶
type TemplateFileResolver struct { Mapper meta.RESTMapper Typer runtime.ObjectTyper ClientMapper resource.ClientMapper Namespace string }
TemplateFileResolver resolves template files into remplate objects
func (*TemplateFileResolver) Resolve ¶
func (r *TemplateFileResolver) Resolve(value string) (*ComponentMatch, error)
Resolve attemps to read the template file and transform it into a template object
type TemplateResolver ¶
type TemplateResolver struct { Client client.TemplatesNamespacer TemplateConfigsNamespacer client.TemplateConfigsNamespacer Namespaces []string }
TemplateResolver resolves stored template arguments into template objects
func (TemplateResolver) Resolve ¶
func (r TemplateResolver) Resolve(value string) (*ComponentMatch, error)
Resolve searches for a template and returns a match with the object representation
type WeightedResolver ¶
WeightedResolver is a resolver identified as exact or not, depending on its weight
type WeightedResolvers ¶
type WeightedResolvers []WeightedResolver
WeightedResolvers is a set of weighted resolvers
func (WeightedResolvers) Resolve ¶
func (r WeightedResolvers) Resolve(value string) (*ComponentMatch, error)
Resolve resolves the provided input and returns both exact and inexact matches