MCPcopy Index your code
hub / github.com/coder/coder / convertTemplateVersionVariable

Function convertTemplateVersionVariable

coderd/templateversions.go:2005–2020  ·  view source on GitHub ↗
(variable database.TemplateVersionVariable)

Source from the content-addressed store, hash-verified

2003const redacted = "*redacted*"
2004
2005func convertTemplateVersionVariable(variable database.TemplateVersionVariable) codersdk.TemplateVersionVariable {
2006 templateVariable := codersdk.TemplateVersionVariable{
2007 Name: variable.Name,
2008 Description: variable.Description,
2009 Type: variable.Type,
2010 Value: variable.Value,
2011 DefaultValue: variable.DefaultValue,
2012 Required: variable.Required,
2013 Sensitive: variable.Sensitive,
2014 }
2015 if templateVariable.Sensitive {
2016 templateVariable.Value = redacted
2017 templateVariable.DefaultValue = redacted
2018 }
2019 return templateVariable
2020}
2021
2022func watchTemplateChannel(id uuid.UUID) string {
2023 return fmt.Sprintf("template:%s", id)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected