Documentation ¶
Index ¶
- func CreateTemplate(ctx context.Context, mc model.ClientSet, entity *model.Template) (*model.Template, error)
- func CreateTemplateVersionsFromRepo(ctx context.Context, mc model.ClientSet, entity *model.Template, ...) error
- func GetRepoFileRaw(repo *vcs.Repository, file string) (string, error)
- func GetTemplateNameByPath(path string) string
- func GetTemplateVersions(entity *model.Template, newVersions []*version.Version, ...) (model.TemplateVersions, error)
- func GetTerraformTemplateFiles(name, content string) (map[string]string, error)
- func SchemaSync(mc model.ClientSet) schemaSyncer
- func SyncTemplateFromGitRepo(ctx context.Context, mc model.ClientSet, entity *model.Template, ...) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTemplate ¶
func CreateTemplate(ctx context.Context, mc model.ClientSet, entity *model.Template) (*model.Template, error)
CreateTemplate creates or updates a template.
func CreateTemplateVersionsFromRepo ¶
func CreateTemplateVersionsFromRepo( ctx context.Context, mc model.ClientSet, entity *model.Template, versions []*version.Version, versionSchema map[*version.Version]*types.TemplateSchema, ) error
CreateTemplateVersionsFromRepo creates template versions and return founded version count from a git repository worktree.
func GetRepoFileRaw ¶
func GetRepoFileRaw(repo *vcs.Repository, file string) (string, error)
GetRepoFileRaw returns raw URL of a file in a git repository.
func GetTemplateNameByPath ¶
func GetTemplateVersions ¶
func GetTemplateVersions( entity *model.Template, newVersions []*version.Version, versionSchema map[*version.Version]*types.TemplateSchema, ) (model.TemplateVersions, error)
GetTemplateVersions retrieves template versions from a git repository. It will save images to the database if they are found in the repository.
func GetTerraformTemplateFiles ¶
GetTerraformTemplateFiles parse a full tf configuration to a map using filename as the key.
func SchemaSync ¶
func SyncTemplateFromGitRepo ¶
func SyncTemplateFromGitRepo( ctx context.Context, mc model.ClientSet, entity *model.Template, repo *vcs.Repository, ) (err error)
SyncTemplateFromGitRepo clones a git repository, retrieves all tags, creates a template and template versions. If the template already exists, it will update the template and template versions. Only semver tags will be used to create template versions.
Types ¶
This section is empty.