Documentation ¶
Overview ¶
Package importers helps with dynamic imports for templating
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct { All Set `toml:"all" json:"all,omitempty"` Test Set `toml:"test" json:"test,omitempty"` Singleton Map `toml:"singleton" json:"singleton,omitempty"` TestSingleton Map `toml:"test_singleton" json:"test_singleton,omitempty"` BasedOnType Map `toml:"based_on_type" json:"based_on_type,omitempty"` }
Collection of imports for various templating purposes Drivers add to any and all of these, and is completely responsible for populating BasedOnType.
func Merge ¶
func Merge(a, b Collection) Collection
Merge takes two collections and creates a new one with the de-duplication contents of both.
func NewDefaultImports ¶
func NewDefaultImports() Collection
NewDefaultImports returns a default Imports struct.
func NullableEnumImports ¶ added in v4.8.4
func NullableEnumImports() Collection
NullableEnumImports returns imports collection for nullable enum types.
type Map ¶
Map of file/type -> imports Map's consumers do not understand windows paths. Always specify paths using forward slash (/).
func MapFromInterface ¶
MapFromInterface creates a Map from a theoretical map[string]interface{} or []map[string]interface{} This is to load from a loosely defined configuration file.
type Set ¶
Set defines the optional standard imports and thirdParty imports (from github for example)
func AddTypeImports ¶
AddTypeImports takes a set of imports 'a', a type -> import mapping 'typeMap' and a set of column types that are currently in use and produces a new set including both the old standard/third party, as well as the imports required for the types in use.
func SetFromInterface ¶
SetFromInterface creates a set from a theoretical map[string]interface{}. This is to load from a loosely defined configuration file.