translate

package
v0.0.0-...-e4bf2a3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGoSuffixFromVersion

func CreateGoSuffixFromVersion(v *version.Version) string

CreateGoSuffixFromVersion convert version into Go suffix e.g. 10.1.1 into _10_1_1

func CreateGoSuffixFromVersionTmpl

func CreateGoSuffixFromVersionTmpl(v any) (string, error)

func GenerateEntryXpath

func GenerateEntryXpath(prefix, suffix, location, xpath string) (string, error)

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 NormalizeAssignmentTmpl(objectType string, param *properties.SpecParam, v any) (string, error)

func OmitEmpty

func OmitEmpty(location *properties.Location) string

OmitEmpty return omitempty in XML tag for location, if there are variables defined.

func PackageName

func PackageName(list []string) string

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

func RenderImports(templateTypes ...string) (string, error)

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 SpecifyEntryAssignmentTmpl

func SpecifyEntryAssignmentTmpl(objectType string, param *properties.SpecParam, v any) (string, error)

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL