Documentation
¶
Index ¶
- Constants
- Variables
- func CleanupAllTestDataResources()
- func FilterTargetsContainingNamespaceRef(targetNodes []*kyaml.RNode, namespaceRef string) ([]*kyaml.RNode, error)
- func GetFileContent(template string, name string, properties map[string]string) string
- func InitProperties(repoUrl, gitHash string) map[string]string
- func ReadYamlDocFromFile(filePath string) (*yamlDoc, error)
- type AppInterfaceClone
- type Application
- type CodeComponent
- type CommitMessage
- type DefaultPromoteCallbacks
- func (c *DefaultPromoteCallbacks) ComputeCommitMessage(resourceTemplateRepo *Repo, resourceTemplatePath, oldHash, newHash string) (*CommitMessage, error)
- func (*DefaultPromoteCallbacks) FilterTargets(targetNodes []*kyaml.RNode) ([]*kyaml.RNode, error)
- func (c *DefaultPromoteCallbacks) GetResourceTemplateRelPath(resourceTemplateNode *kyaml.RNode) (string, error)
- func (c *DefaultPromoteCallbacks) GetResourceTemplateRepoUrl(resourceTemplateNode *kyaml.RNode) (string, error)
- func (c *DefaultPromoteCallbacks) GetTargetHash(targetNode *kyaml.RNode) (string, error)
- func (c *DefaultPromoteCallbacks) SetTargetHash(targetNode *kyaml.RNode, newHash string) error
- type PromoteCallbacks
- type Repo
- type Service
- func (s *Service) GetApplication() *Application
- func (d *Service) GetFilePath() string
- func (s *Service) GetName() string
- func (s *Service) GetResourceTemplatesSequenceNode() *kyaml.RNode
- func (s *Service) GetRootNode() *kyaml.RNode
- func (s *Service) Promote(callbacks PromoteCallbacks, newHash string) error
- func (d *Service) Save() error
- type ServicesRegistry
- type TestData
- func (d *TestData) CheckAppInterfaceBranchName(expectedBranchName string)
- func (d *TestData) CheckAppInterfaceCommitMessage(commitIndex int, expectedSubString string)
- func (d *TestData) CheckAppInterfaceCommitStats(commitIndex, filesCount int, fileRelPath string, ...)
- func (d *TestData) CheckAppInterfaceFileContent(fileRelPath, expectedTemplate, expectedName string, ...)
- func (d *TestData) CheckAppInterfaceIsClean()
- func (d *TestData) CheckAppInterfaceService1Content(expectedTemplate string, expectedProperties map[string]string)
- func (d *TestData) CommitAppInterfaceChanges(commitMessage string)
- func (d *TestData) GetAppInterfaceCommit(index int) *object.Commit
- func (d *TestData) GetAppInterfaceCommitsCount() int
- func (d *TestData) GetTestRepoFormattedLog(hashIndexes ...int) string
- func (d *TestData) ReadAppInterfaceFile(fileRelPath string) string
- func (d *TestData) WriteAppInterfaceFile(fileRelPath string, fileContent string)
- type ValidateServiceFilePathCallback
Constants ¶
View Source
const ( ServiceFileContentTemplate = `` /* 942-byte string literal not displayed */ AppFileContentTemplate = `` /* 183-byte string literal not displayed */ AppFileContentTemplateWithHotfixVersion = AppFileContentTemplate + ` hotfixVersions: - @hotfixVersion@ ` AppFileContentTemplateWithHotfixVersions = AppFileContentTemplate + ` hotfixVersions: - @hotfixVersion1@ - @hotfixVersion2@ ` )
View Source
const CommitTemplate = `commit %s
Author: John Doe <john.doe@company.com>
Date: Thu Jan 01 00:00:00 1970 +0000
Commit #%d
`
View Source
const (
DefaultProdNamespaceRef = "hivep"
)
Variables ¶
View Source
var DefaultSignature = object.Signature{
Name: "John Doe",
Email: "john.doe@company.com",
}
Functions ¶
func CleanupAllTestDataResources ¶
func CleanupAllTestDataResources()
func GetFileContent ¶
func InitProperties ¶
func ReadYamlDocFromFile ¶
Types ¶
type AppInterfaceClone ¶
type AppInterfaceClone struct {
// contains filtered or unexported fields
}
func FindAppInterfaceClone ¶
func FindAppInterfaceClone(providedPath string) (*AppInterfaceClone, error)
func (*AppInterfaceClone) CheckoutNewBranch ¶
func (a *AppInterfaceClone) CheckoutNewBranch(branchName string) error
func (*AppInterfaceClone) Commit ¶
func (a *AppInterfaceClone) Commit(commitMessage string) error
func (*AppInterfaceClone) GetPath ¶
func (a *AppInterfaceClone) GetPath() string
func (*AppInterfaceClone) IsClean ¶
func (a *AppInterfaceClone) IsClean() (bool, error)
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func (*Application) GetComponent ¶
func (a *Application) GetComponent(componentUrl string) (*CodeComponent, error)
func (*Application) GetFilePath ¶
func (d *Application) GetFilePath() string
type CodeComponent ¶
type CodeComponent struct {
// contains filtered or unexported fields
}
func (*CodeComponent) GetName ¶
func (c *CodeComponent) GetName() string
func (*CodeComponent) SetHotfixVersion ¶
func (c *CodeComponent) SetHotfixVersion(hotfixVersion string) error
type CommitMessage ¶
type DefaultPromoteCallbacks ¶
type DefaultPromoteCallbacks struct {
Service *Service
}
func (*DefaultPromoteCallbacks) ComputeCommitMessage ¶
func (c *DefaultPromoteCallbacks) ComputeCommitMessage(resourceTemplateRepo *Repo, resourceTemplatePath, oldHash, newHash string) (*CommitMessage, error)
func (*DefaultPromoteCallbacks) FilterTargets ¶
func (*DefaultPromoteCallbacks) GetResourceTemplateRelPath ¶
func (c *DefaultPromoteCallbacks) GetResourceTemplateRelPath(resourceTemplateNode *kyaml.RNode) (string, error)
func (*DefaultPromoteCallbacks) GetResourceTemplateRepoUrl ¶
func (c *DefaultPromoteCallbacks) GetResourceTemplateRepoUrl(resourceTemplateNode *kyaml.RNode) (string, error)
func (*DefaultPromoteCallbacks) GetTargetHash ¶
func (c *DefaultPromoteCallbacks) GetTargetHash(targetNode *kyaml.RNode) (string, error)
func (*DefaultPromoteCallbacks) SetTargetHash ¶
func (c *DefaultPromoteCallbacks) SetTargetHash(targetNode *kyaml.RNode, newHash string) error
type PromoteCallbacks ¶
type PromoteCallbacks interface {
GetResourceTemplateRepoUrl(resourceTemplateNode *kyaml.RNode) (string, error)
GetResourceTemplateRelPath(resourceTemplateNode *kyaml.RNode) (string, error)
FilterTargets(targetNodes []*kyaml.RNode) ([]*kyaml.RNode, error)
GetTargetHash(targetNode *kyaml.RNode) (string, error)
SetTargetHash(targetNode *kyaml.RNode, newHash string) error
ComputeCommitMessage(resourceTemplateRepo *Repo, resourceTemplatePath, currentHash, newHash string) (*CommitMessage, error)
}
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func (*Repo) FormattedLog ¶
func (*Repo) GetHeadHash ¶
func (*Repo) ResolveHash ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func ReadServiceFromFile ¶
func ReadServiceFromFile(appInterfaceClone *AppInterfaceClone, filePath string) (*Service, error)
func (*Service) GetApplication ¶
func (s *Service) GetApplication() *Application
func (*Service) GetFilePath ¶
func (d *Service) GetFilePath() string
func (*Service) GetResourceTemplatesSequenceNode ¶
func (*Service) GetRootNode ¶
type ServicesRegistry ¶
type ServicesRegistry struct {
// contains filtered or unexported fields
}
func CreateDefaultServiceRegistry ¶
func CreateDefaultServiceRegistry(data *TestData) *ServicesRegistry
func CreateServiceRegistry ¶
func CreateServiceRegistry(data *TestData, validateServiceFilePathCallback ValidateServiceFilePathCallback, servicesDirsRelPaths ...string) *ServicesRegistry
func NewServicesRegistry ¶
func NewServicesRegistry(appInterfaceClone *AppInterfaceClone, validateServiceFilePathCallback ValidateServiceFilePathCallback, servicesDirsRelPaths ...string) (*ServicesRegistry, error)
func (*ServicesRegistry) GetService ¶
func (r *ServicesRegistry) GetService(serviceId string) (*Service, error)
func (*ServicesRegistry) GetServicesIds ¶
func (r *ServicesRegistry) GetServicesIds() []string
type TestData ¶
func CreateDefaultTestData ¶
func CreateDefaultTestData() *TestData
func CreateTestData ¶
func (*TestData) CheckAppInterfaceBranchName ¶
func (*TestData) CheckAppInterfaceCommitMessage ¶
func (*TestData) CheckAppInterfaceCommitStats ¶
func (*TestData) CheckAppInterfaceFileContent ¶
func (*TestData) CheckAppInterfaceIsClean ¶
func (d *TestData) CheckAppInterfaceIsClean()
func (*TestData) CheckAppInterfaceService1Content ¶
func (*TestData) CommitAppInterfaceChanges ¶
func (*TestData) GetAppInterfaceCommit ¶
func (*TestData) GetAppInterfaceCommitsCount ¶
func (*TestData) GetTestRepoFormattedLog ¶
func (*TestData) ReadAppInterfaceFile ¶
func (*TestData) WriteAppInterfaceFile ¶
Click to show internal directories.
Click to hide internal directories.