Documentation
¶
Index ¶
- func CreateGoSuffixFromVersion(v *version.Version) string
- func CreateGoSuffixFromVersionTmpl(v any) (string, error)
- func GenerateEntryXpath(prefix, suffix, location, xpath string) (string, error)
- func LocationType(location *properties.Location, pointer bool) string
- func NestedSpecMatchesFunction(spec *properties.Spec) string
- func NestedSpecs(spec *properties.Spec) (map[string]*properties.Spec, error)
- func NormalizeAssignment(objectType string, param *properties.SpecParam, version *version.Version) string
- func NormalizeAssignmentTmpl(objectType string, param *properties.SpecParam, v any) (string, error)
- func OmitEmpty(location *properties.Location) string
- func PackageName(list []string) string
- func ParamSupportedInVersion(param *properties.SpecParam, deviceVersion *version.Version) bool
- func ParamSupportedInVersionTmpl(param *properties.SpecParam, deviceVersion any) (bool, error)
- func RenderEntryImportStructs(spec *properties.Normalization) (string, error)
- func RenderImports(templateTypes ...string) (string, error)
- func SpecMatchesFunction(param *properties.SpecParam) string
- func SpecParamType(parent string, param *properties.SpecParam) string
- func SpecifyEntryAssignment(objectType string, param *properties.SpecParam, v *version.Version) string
- func SpecifyEntryAssignmentTmpl(objectType string, param *properties.SpecParam, v any) (string, error)
- func XmlName(param *properties.SpecParam) string
- func XmlParamType(parent string, param *properties.SpecParam) string
- func XmlPathSuffixes(param *properties.SpecParam) []string
- func XmlTag(param *properties.SpecParam) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateGoSuffixFromVersion ¶
CreateGoSuffixFromVersion convert version into Go suffix e.g. 10.1.1 into _10_1_1
func GenerateEntryXpath ¶
GenerateEntryXpath functions used in location.tmpl to generate XPath for location.
func LocationType ¶
func LocationType(location *properties.Location, pointer bool) string
LocationType function used in template location.tmpl to generate location type name.
func NestedSpecMatchesFunction ¶
func NestedSpecMatchesFunction(spec *properties.Spec) string
NestedSpecMatchesFunction return a string with body of specMach* functions required for nested params
func NestedSpecs ¶
func NestedSpecs(spec *properties.Spec) (map[string]*properties.Spec, error)
NestedSpecs goes through all params and one ofs (recursively) and returns map of all nested specs.
func NormalizeAssignment ¶
func NormalizeAssignment(objectType string, param *properties.SpecParam, version *version.Version) string
NormalizeAssignment generates a string, which contains entry/config assignment in Normalize() function in entry.tmpl/config.tmpl template. If param contains nested specs, then recursively are executed internal functions, which are creating entry assignment.
func NormalizeAssignmentTmpl ¶
func OmitEmpty ¶
func OmitEmpty(location *properties.Location) string
OmitEmpty return omitempty in XML tag for location, if there are variables defined.
func PackageName ¶
PackageName get package name from Go SDK path.
func ParamSupportedInVersion ¶
func ParamSupportedInVersion(param *properties.SpecParam, deviceVersion *version.Version) bool
ParamSupportedInVersion checks if param is supported in specific PAN-OS version
func ParamSupportedInVersionTmpl ¶
func ParamSupportedInVersionTmpl(param *properties.SpecParam, deviceVersion any) (bool, error)
func RenderEntryImportStructs ¶
func RenderEntryImportStructs(spec *properties.Normalization) (string, error)
func RenderImports ¶
RenderImports render string, which contains import required in entry, location or service template.
func SpecMatchesFunction ¶
func SpecMatchesFunction(param *properties.SpecParam) string
SpecMatchesFunction return a string used in function SpecMatches() in entry.tmpl/config.tmpl to compare all items of generated entry.
func SpecParamType ¶
func SpecParamType(parent string, param *properties.SpecParam) string
SpecParamType returns param type (it can be a nested spec) for structs based on spec from YAML files.
func SpecifyEntryAssignment ¶
func SpecifyEntryAssignment(objectType string, param *properties.SpecParam, v *version.Version) string
SpecifyEntryAssignment generates a string, which contains entry/config assignment in SpecifyEntry() function in entry.tmpl/config.tmpl template. If param contains nested specs, then recursively are executed internal functions, which are creating entry assignment.
func XmlName ¶
func XmlName(param *properties.SpecParam) string
XmlName creates a string with xml name (e.g. `description`).
func XmlParamType ¶
func XmlParamType(parent string, param *properties.SpecParam) string
XmlParamType return param type (it can be nested spec) (for struct based on spec from YAML files).
func XmlPathSuffixes ¶
func XmlPathSuffixes(param *properties.SpecParam) []string
XmlPathSuffixes return XML path suffixes created from profiles.
func XmlTag ¶
func XmlTag(param *properties.SpecParam) string
XmlTag creates a string with xml tag (e.g. `xml:"description,omitempty"`).
Types ¶
This section is empty.