Documentation ¶
Index ¶
- func FetchTemplateVariableYaml(source string, logger *zap.SugaredLogger) (string, error)
- func GetTemplateVariableYaml(variables []*models.Variable, variableYaml string) (string, error)
- func GetYamlVariables(s string, logger *zap.SugaredLogger) ([]*models.ChartVariable, error)
- func SafeMergeVariableYaml(variableYamls ...string) (string, map[string]string, error)
- type BuildReference
- type BuildTemplateReference
- type Chart
- type DockerfileDetail
- type DockerfileListObject
- type DockerfileTemplate
- type ScanningTemplateReference
- type ServiceReference
- type YamlDetail
- type YamlListObject
- type YamlTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchTemplateVariableYaml ¶
func FetchTemplateVariableYaml(source string, logger *zap.SugaredLogger) (string, error)
FetchTemplateVariableYaml extract variables from go template yaml and package them into yaml supports most standard go-template grammar, but can't deal with complex situation like range in range / local vars using $ NOTE the return value should not be fully trusted
func GetTemplateVariableYaml ¶
GetTemplateVariableYaml returns variable yaml of yamlTemplate or templateService
func GetYamlVariables ¶
func GetYamlVariables(s string, logger *zap.SugaredLogger) ([]*models.ChartVariable, error)
GetYamlVariables extract variables from go template yaml to Zadig-defined vars use regex to search {{.rar}} and turn to {key: var} NOTE this function DOES NOT support full go-template grammar, like {{- range }} / {{- eq }} / {{- if }} / nested data technically this function should be deprecated
Types ¶
type BuildReference ¶
type BuildTemplateReference ¶
type Chart ¶
type Chart struct { Name string `json:"name"` CodehostID int `json:"codehostID"` Owner string `json:"owner"` Namespace string `json:"namespace"` Repo string `json:"repo"` Branch string `json:"branch"` Path string `json:"path"` Variables []*models.ChartVariable `json:"variables,omitempty"` Files []*fs.FileInfo `json:"files,omitempty"` }
type DockerfileDetail ¶
type DockerfileDetail struct { ID string `json:"id"` Name string `json:"name"` Content string `json:"content"` Variables []*models.ChartVariable `json:"variable"` }
func GetDockerfileTemplateDetail ¶
func GetDockerfileTemplateDetail(id string, logger *zap.SugaredLogger) (*DockerfileDetail, error)
type DockerfileListObject ¶
type DockerfileTemplate ¶
type ServiceReference ¶
type YamlDetail ¶
type YamlDetail struct { ID string `json:"id"` Name string `json:"name"` Content string `json:"content"` VariableYaml string `json:"variable_yaml"` ServiceVariableKVs []*commontypes.ServiceVariableKV `json:"service_variable_kvs"` }
type YamlListObject ¶
type YamlTemplate ¶
type YamlTemplate struct { Name string `json:"name"` Content string `json:"content"` VariableYaml string `json:"variable_yaml"` ServiceVariableKVs []*commontypes.ServiceVariableKV `json:"service_variable_kvs"` }
Click to show internal directories.
Click to hide internal directories.