Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOrCreateMassDir ¶
func GithubTemplatesFetcher ¶
Function for fetching templates from multiple Github repositories.
Types ¶
type BundleTemplateCache ¶
func (*BundleTemplateCache) GetTemplatePath ¶
func (b *BundleTemplateCache) GetTemplatePath() (string, error)
Get the path to the template directory
func (*BundleTemplateCache) ListTemplates ¶
func (b *BundleTemplateCache) ListTemplates() ([]TemplateList, error)
List all templates available in cache
func (*BundleTemplateCache) RefreshTemplates ¶
func (b *BundleTemplateCache) RefreshTemplates() error
Refresh available templates from Massdriver official Github repository.
func (*BundleTemplateCache) RenderTemplate ¶
func (b *BundleTemplateCache) RenderTemplate(data *TemplateData) error
Clones the desired template to the directory specified by the user and renders the massdriver YAML with user supplied values.
type CloneError ¶
type Commit ¶
type Commit struct {
SHA string `json:"sha,omitempty"`
}
Comit represents a commit from the github API, however, we only need the sha at this point
type Connection ¶
type TemplateCache ¶
type TemplateCache interface { RefreshTemplates() error ListTemplates() ([]TemplateList, error) GetTemplatePath() (string, error) RenderTemplate(*TemplateData) error }
func NewBundleTemplateCache ¶
func NewBundleTemplateCache(fetch Fetcher) (TemplateCache, error)
Template cache factory which will create a new instance of BundleTemplateCache. Requires a function as a dependency to handle retreival of templates which can in turn be mocked for testing.
func NewMockClient ¶
func NewMockClient(rootTemplateDir string) TemplateCache
type TemplateData ¶
type TemplateData struct { Name string `json:"name"` Description string `json:"description"` Access string `json:"access"` Location string `json:"location"` TemplateName string `json:"templateName"` TemplateRepo string `json:"templateRepo"` OutputDir string `json:"outputDir"` Type string `json:"type"` Connections []Connection `json:"connections"` Envs map[string]string `json:"envs"` // ParamsSchema is a YAML formatted string ParamsSchema string `json:"paramsSchema"` // Path to a terraform-module or helm-chart to parse for params ExistingParamsPath string `json:"existingParamsPath"` // Specificaly for the README CloudAbbreviation string `json:"cloudAbbreviation"` RepoName string `json:"repoName"` RepoNameEncoded string `json:"repoNameEncoded"` }
type TemplateList ¶
Click to show internal directories.
Click to hide internal directories.