Documentation ¶
Index ¶
- Variables
- func CompareURLs(a, b string) bool
- func ExtractBuildNames(results ...SearchResult) []string
- func SanitizeURL(rawURL string) (string, error)
- type Interface
- type Inventory
- func (i *Inventory) Add(b *buildapi.Build)
- func (i *Inventory) Remove(buildName types.NamespacedName)
- func (i *Inventory) SearchForGit(triggerType buildapi.TriggerType, repoURL string, branch string) []SearchResult
- func (i *Inventory) SearchForObjectRef(triggerType buildapi.TriggerType, objectRef *buildapi.WhenObjectRef) []SearchResult
- type SearchFn
- type SearchResult
- type TriggerRules
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidGItURL = errors.New("invalid git scheme URL")
ErrInvalidGItURL unable to parse git scheme URL
Functions ¶
func ExtractBuildNames ¶
func ExtractBuildNames(results ...SearchResult) []string
ExtractBuildNames picks the build names from informed SearchResult slice.
func SanitizeURL ¶
SanitizeURL takes a raw repository URL and returns only the hostname and path, removing possible prefix protocol, and extension suffix.
Types ¶
type Interface ¶
type Interface interface { Add(*buildapi.Build) Remove(types.NamespacedName) SearchForObjectRef(buildapi.TriggerType, *buildapi.WhenObjectRef) []SearchResult SearchForGit(buildapi.TriggerType, string, string) []SearchResult }
type Inventory ¶
type Inventory struct {
// contains filtered or unexported fields
}
Inventory keeps track of Build object details, on which it can find objects that match the repository URL and trigger rules.
func (*Inventory) Remove ¶
func (i *Inventory) Remove(buildName types.NamespacedName)
Remove the informed entry from the cache.
func (*Inventory) SearchForGit ¶
func (i *Inventory) SearchForGit( triggerType buildapi.TriggerType, repoURL string, branch string, ) []SearchResult
SearchForGit search for builds using the Git repository details, like the URL, branch name and such type of information.
func (*Inventory) SearchForObjectRef ¶
func (i *Inventory) SearchForObjectRef( triggerType buildapi.TriggerType, objectRef *buildapi.WhenObjectRef, ) []SearchResult
SearchForObjectRef search for builds using the ObjectRef as query parameters.
type SearchResult ¶
type SearchResult struct { BuildName types.NamespacedName // build name matching criteria SecretName types.NamespacedName // respective secret coordinates (for webhook) }
SearchResult contains a Inventory result item.
func (*SearchResult) HasSecret ¶
func (s *SearchResult) HasSecret() bool
HasSecret assert if the SecretName is defined.
type TriggerRules ¶
type TriggerRules struct {
// contains filtered or unexported fields
}
TriggerRules keeps the source and webhook trigger information for each Build instance.