model

package
v40.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

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

type AliasPackage ast.Package

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

type ErrorUnexpectedToken struct {
	Expected token.Token
	Received token.Token
}

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"`
}

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.

type PathInfo

type PathInfo struct {
	IsArm    bool
	Provider string
	Version  string
	Group    string
	ModVer   string
	APIPkg   string
}

PathInfo provides information about a package's path.

func DeconstructPath

func DeconstructPath(path string) (PathInfo, error)

DeconstructPath takes a full package path and deconstructs it into its constituent parts.

Jump to

Keyboard shortcuts

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