templates

package
v2.932.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SupportedSDKDocsLanguages = []string{"go", "python", "typescript", "csharp", "unity", "java", "curl"}

Functions

func AllSupportedTargets

func AllSupportedTargets() []types.Target

func AllSupportedTemplateNames

func AllSupportedTemplateNames() []string

func CheckLanguageSupported deprecated

func CheckLanguageSupported(language string) bool

Deprecated: Use IsSupportedTemplateName or IsSupportedSDKTemplateName instead.

func GetAllTemplateDependencies

func GetAllTemplateDependencies() (map[string][]TemplateDependency, error)

GetAllTemplateDependencies returns the structured dependency list for all targets

func GetAvailableTemplates

func GetAvailableTemplates() []string

func GetCPEToTemplatesMap

func GetCPEToTemplatesMap() (map[string][]DependencyWithTemplate, error)

GetCPEToTemplatesMap returns a map of CPE to all templates that use it This properly handles cases where multiple templates share the same dependency

func GetLanguageConfigFields

func GetLanguageConfigFields(target types.Target, newSDK bool) ([]config.SDKGenConfigField, error)

func GetMinimumTargetVersion

func GetMinimumTargetVersion() map[string]string

func GetSupportedLanguages deprecated

func GetSupportedLanguages() []string

Deprecated: Use AllSupportedTemplateNames or GetSupportedSDKTemplateNames instead.

func GetSupportedMCPTargets

func GetSupportedMCPTargets() []types.Target

Returns the supported MCP targets based on the templates directories.

func GetSupportedMCPTemplateNames

func GetSupportedMCPTemplateNames() []string

Returns the supported MCP template names based on the templates directories.

func GetSupportedSDKTargets

func GetSupportedSDKTargets() []types.Target

Returns the supported SDK targets based on the templates directories.

func GetSupportedSDKTemplateNames

func GetSupportedSDKTemplateNames() []string

Returns the supported SDK template names based on the templates directories.

func GetSupportedTargets deprecated

func GetSupportedTargets() []types.Target

Deprecated: Use AllSupportedTargets or GetSupportedSDKTargets instead.

func GetSupportedTerraformTargets

func GetSupportedTerraformTargets() []types.Target

Returns the supported Terraform targets based on the templates directories.

func GetSupportedTerraformTemplateNames

func GetSupportedTerraformTemplateNames() []string

Returns the supported Terraform template names based on the templates directories.

func GetTargetFromTargetString

func GetTargetFromTargetString(target string) (types.Target, error)

func GetUniqueCPEs

func GetUniqueCPEs() ([]string, error)

GetUniqueCPEs returns a deduplicated list of all CPE identifiers across all targets

func IsSupportedMCPTemplateName

func IsSupportedMCPTemplateName(templateName string) bool

Returns true if given template name is a supported MCP template.

Checks include:

  • Whether the template is outside MCP template naming.
  • Whether the template name exists in the templates directory.
  • Whether the template is hidden (i.e., does not have a "HIDDEN" file in its directory).

func IsSupportedSDKTemplateName

func IsSupportedSDKTemplateName(templateName string) bool

Returns true if given template name is a supported SDK template.

Checks include:

  • Whether the template is outside SDK templates, such as "common" (used for shared code), starts with "mcp-" (MCP templates), "terraform" (Terraform template).
  • Whether the template name exists in the templates directory.
  • Whether the template is hidden (i.e., does not have a "HIDDEN" file in its directory).

func IsSupportedTemplateName

func IsSupportedTemplateName(templateName string) bool

func IsSupportedTerraformTemplateName

func IsSupportedTerraformTemplateName(templateName string) bool

Returns true if given template name is a supported Terraform template.

Checks include:

  • Whether the template is outside Terraform template naming.
  • Whether the template name exists in the templates directory.
  • Whether the template is hidden (i.e., does not have a "HIDDEN" file in its directory).

func ResolveConfig

func ResolveConfig(cfg *config.Configuration, target types.Target, outDir string, fs filesystem.FileSystem) error

Types

type DependencyWithTemplate

type DependencyWithTemplate struct {
	TemplateName string
	Dependency   TemplateDependency
}

DependencyWithTemplate associates a dependency with its source template

type TemplateDependency

type TemplateDependency struct {
	Name      string `mapstructure:"name"`
	Version   string `mapstructure:"version"`
	CPE       string `mapstructure:"cpe"`
	Ecosystem string `mapstructure:"ecosystem"`
	Category  string `mapstructure:"category"`
	Condition string `mapstructure:"condition,omitempty"`
}

TemplateDependency represents a structured dependency with CPE identifier for security scanning

func GetTemplateDependencies

func GetTemplateDependencies(target types.Target) ([]TemplateDependency, error)

GetTemplateDependencies returns the structured dependency list for a given target

Jump to

Keyboard shortcuts

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