Documentation ¶
Overview ¶
Package model holds the business logic for the operations made available by profileBuilder.
This package is not governed by the SemVer associated with the rest of the Azure-SDK-for-Go.
Package model holds the business logic for the operations made available by profileBuilder.
This package is not governed by the SemVer associated with the rest of the Azure-SDK-for-Go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildProfile ¶
func BuildProfile(packageList ListDefinition, name, outputLocation string, outputLog, errLog *log.Logger, recursive, modules bool)
BuildProfile takes a list of packages and creates a profile
Types ¶
type AliasPackage ¶
AliasPackage is an abstraction around ast.Package to provide convenience methods for manipulating it.
func NewAliasPackage ¶
func NewAliasPackage(original *ast.Package, importPath string) (*AliasPackage, error)
NewAliasPackage creates an alias package from the specified input package. Parameter importPath is the import path specified to consume the package.
func (*AliasPackage) AddConst ¶
func (alias *AliasPackage) AddConst(decl *ast.GenDecl) error
AddConst adds a Const block with indiviual aliases for each Spec in `decl`.
func (*AliasPackage) AddFunc ¶
func (alias *AliasPackage) AddFunc(decl *ast.FuncDecl) error
AddFunc creates a stub method to redirect the call to the original package, then adds it to the model file.
func (*AliasPackage) AddGeneral ¶
func (alias *AliasPackage) AddGeneral(decl *ast.GenDecl) error
AddGeneral handles dispatching a GenDecl to either AddConst or AddType.
func (*AliasPackage) AddType ¶
func (alias *AliasPackage) AddType(decl *ast.GenDecl) error
AddType adds a Type delcaration block with individual alias for each Spec handed in `decl`
func (AliasPackage) ModelFile ¶
func (alias AliasPackage) ModelFile() *ast.File
ModelFile is a getter for the file accumulating aliased content.
type ErrorUnexpectedToken ¶
ErrorUnexpectedToken is returned when AST parsing encounters an unexpected token, it includes the expected token.
func (ErrorUnexpectedToken) Error ¶
func (utoken ErrorUnexpectedToken) Error() string
type ListDefinition ¶
type ListDefinition struct { Include []string `json:"include"` PathOverride map[string]string `json:"pathOverride"` IgnoredPaths []string `json:"ignoredPaths"` }
ListDefinition represents a JSON file that contains a list of packages to include
func GetLatestPackages ¶
func GetLatestPackages(rootDir string, includePreview bool, verboseLog *log.Logger) (ListDefinition, error)
GetLatestPackages returns the collection of latest packages in terms of API and module version.