Ejemplo n.º 1
0
// Get all commits (versions) of a specified template
//(inclues duplicates due to multple release role.  caller needs to process it properly)
func GetTemplateCommits(c *gin.Context) {
	template_name := c.Params.ByName("template_name")

	var template tf.Template
	templates := template.GetTemplates()
	var templates_by_name []tf.Template
	for _, t := range templates {
		if t.Template_name == template_name {
			templates_by_name = append(templates_by_name, t)
		}
	}

	c.JSON(http.StatusOK, templates_by_name)

}
Ejemplo n.º 2
0
// Get all templates (versions and duplicates due to multiple release role)
func GetTemplates(c *gin.Context) {
	var template tf.Template

	c.JSON(http.StatusOK, template.GetTemplates())
}