codegen

package
v2.25.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanDir added in v2.7.0

func CleanDir(dirPath string, exclusions StringSet) error

CleanDir removes all existing files from a directory except those in the exclusions list. Note: The exclusions currently don't function recursively, so you cannot exclude a single file in a subdirectory, only entire subdirectories. This function will need improvements to be able to target that use-case.

func ExpandShortEnumName added in v2.14.0

func ExpandShortEnumName(name string) string

func FilterExamples added in v2.5.0

func FilterExamples(description string, lang string) string

FilterExamples filters the code snippets in a schema docstring to include only those that target the given language.

func SortedKeys

func SortedKeys(m interface{}) []string

SortedKeys returns a sorted list of keys for the given map. The map's key type must be of kind string.

Types

type DocLanguageHelper

type DocLanguageHelper interface {
	GetPropertyName(p *schema.Property) (string, error)
	GetEnumName(e *schema.Enum, typeName string) (string, error)
	GetDocLinkForResourceType(pkg *schema.Package, moduleName, typeName string) string
	GetDocLinkForPulumiType(pkg *schema.Package, typeName string) string
	GetDocLinkForResourceInputOrOutputType(pkg *schema.Package, moduleName, typeName string, input bool) string
	GetDocLinkForFunctionInputOrOutputType(pkg *schema.Package, moduleName, typeName string, input bool) string
	GetLanguageTypeString(pkg *schema.Package, moduleName string, t schema.Type, input, optional bool) string

	GetFunctionName(modName string, f *schema.Function) string
	// GetResourceFunctionResultName returns the name of the result type when a static resource function is used to lookup
	// an existing resource.
	GetResourceFunctionResultName(modName string, f *schema.Function) string
	// GetModuleDocLink returns the display name and the link for a module (including root modules) in a given package.
	GetModuleDocLink(pkg *schema.Package, modName string) (string, string)
}

DocLanguageHelper is an interface for extracting language-specific information from a Pulumi schema. See the implementation for this interface under each of the language code generators.

type Set

type Set map[interface{}]struct{}

func (Set) Add

func (s Set) Add(v interface{})

func (Set) Has

func (s Set) Has(v interface{}) bool

type StringSet

type StringSet map[string]struct{}

func NewStringSet

func NewStringSet(values ...string) StringSet

func (StringSet) Add

func (ss StringSet) Add(s string)

func (StringSet) Any added in v2.20.0

func (ss StringSet) Any() bool

func (StringSet) Delete added in v2.2.0

func (ss StringSet) Delete(s string)

func (StringSet) Has

func (ss StringSet) Has(s string) bool

func (StringSet) SortedValues

func (ss StringSet) SortedValues() []string

Directories

Path Synopsis
Pulling out some of the repeated strings tokens into constants would harm readability, so we just ignore the goconst linter's warning.
Pulling out some of the repeated strings tokens into constants would harm readability, so we just ignore the goconst linter's warning.
nolint: lll Pulling out some of the repeated strings tokens into constants would harm readability, so we just ignore the goconst linter's warning.
nolint: lll Pulling out some of the repeated strings tokens into constants would harm readability, so we just ignore the goconst linter's warning.
Pulling out some of the repeated strings tokens into constants would harm readability, so we just ignore the goconst linter's warning.
Pulling out some of the repeated strings tokens into constants would harm readability, so we just ignore the goconst linter's warning.
nolint: goconst
nolint: goconst
internal
Pulling out some of the repeated strings tokens into constants would harm readability, so we just ignore the goconst linter's warning.
Pulling out some of the repeated strings tokens into constants would harm readability, so we just ignore the goconst linter's warning.
Pulling out some of the repeated strings tokens into constants would harm readability, so we just ignore the goconst linter's warning.
Pulling out some of the repeated strings tokens into constants would harm readability, so we just ignore the goconst linter's warning.

Jump to

Keyboard shortcuts

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