Documentation ¶
Index ¶
- func NewGoLangSourceFileReader(fileName string, ignoredLines *IgnoredLines) *golangSourceFileReader
- func NewGoSourceAPILine(fileName string, fullLine string, lineNum int, httpMethod string, ...) *goSourceAPILine
- func NewOASModel(specFile string) *oasModel
- func ReadFile(filename string) (error, []string)
- type DiffWorker
- type GoSourceScanner
- type IgnoredAPIPaths
- type IgnoredDirectories
- type IgnoredFiles
- type IgnoredLines
- type OpenAPISpecCodeDiffsResult
- type OpenAPISpecCodeDiffsValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGoLangSourceFileReader ¶
func NewGoLangSourceFileReader(fileName string, ignoredLines *IgnoredLines) *golangSourceFileReader
NewGoLangSourceFileReader Returns a new golangSourceFileReader
Types ¶
type DiffWorker ¶
type DiffWorker struct {
// contains filtered or unexported fields
}
DiffWorker Structure for use as inputs by diff worker, consisting of definitions found in code, specs and api definitions to be ignored
func NewDiffWorker ¶
func NewDiffWorker(codeAPIDefs []*goSourceAPILine, specAPIDefs []string, ignoredAPIDefs *IgnoredAPIPaths) *DiffWorker
NewDiffWorker Returns a new DiffWorker
func (*DiffWorker) ValidateCodeDefsNotInSpec ¶
func (v *DiffWorker) ValidateCodeDefsNotInSpec() (error, []string)
ValidateCodeDefsNotInSpec Returns api paths found in code but not defined in spec
func (*DiffWorker) ValidateSpecDefsNotInCode ¶
func (v *DiffWorker) ValidateSpecDefsNotInCode() (error, []string)
ValidateSpecDefsNotInCode Returns api paths defined in spec but not found in code
type GoSourceScanner ¶
type GoSourceScanner struct {
// contains filtered or unexported fields
}
GoSourceScanner Structure to specify root golang source directory and directories/files/lines to be ignored for scanning of API path definitions
func NewGoSourceScanner ¶
func NewGoSourceScanner(dir string, ignoredDirectories *IgnoredDirectories, ignoredFiles *IgnoredFiles, ignoredLines *IgnoredLines) *GoSourceScanner
NewGoSourceScanner Returns a new GoSourceScanner
func (*GoSourceScanner) ScanSourcesForAPIDefs ¶
func (gss *GoSourceScanner) ScanSourcesForAPIDefs() (error, []*goSourceAPILine)
ScanSourcesForAPIDefs Recursively walks the directory, analyzes golang source files to find API definitions ignoring directories found in .dirignore, ignoring files in .fileignore, ignoring lines in .lineignore
type IgnoredAPIPaths ¶
type IgnoredAPIPaths struct {
// contains filtered or unexported fields
}
IgnoredAPIPaths Array of API paths to be ignored while working out diffs between code and specs
func NewIgnoredAPIRoutes ¶
func NewIgnoredAPIRoutes(ignoredAPIPathsFile string) (error, *IgnoredAPIPaths)
NewIgnoredAPIRoutes Returns a new IgnoredAPIPaths
type IgnoredDirectories ¶
type IgnoredDirectories struct {
// contains filtered or unexported fields
}
IgnoredDirectories Directories to be ignored while coming up with diffs e.g. /bin, /out
func NewIgnoredDirectories ¶
func NewIgnoredDirectories(ignoreDirFileName string) (error, *IgnoredDirectories)
NewIgnoredDirectories Returns new IgnoredDirectories
type IgnoredFiles ¶
type IgnoredFiles struct {
// contains filtered or unexported fields
}
IgnoredFiles Files to be ignored while coming up with diffs
func NewIgnoredFiles ¶
func NewIgnoredFiles(ignoreFilesFileName string) (error, *IgnoredFiles)
NewIgnoredFiles Returns new IgnoredFiles
type IgnoredLines ¶
type IgnoredLines struct {
// contains filtered or unexported fields
}
IgnoredLines Files to be ignored while coming up with diffs
func NewIgnoredLines ¶
func NewIgnoredLines(ignoredLinesFileName string) (error, *IgnoredLines)
NewIgnoredLines Returns new IgnoredLines
type OpenAPISpecCodeDiffsResult ¶
OpenAPISpecCodeDiffsResult Represents results of diff operation between golang source code and OpenAPI Specs
type OpenAPISpecCodeDiffsValidator ¶
type OpenAPISpecCodeDiffsValidator struct {
// contains filtered or unexported fields
}
OpenAPISpecCodeDiffsValidator The main input struct for this validation tool
func NewOpenAPISpecCodeDiffsValidator ¶
func NewOpenAPISpecCodeDiffsValidator(ignoredDirFile string, ignoredFilesFile string, ignoredLinesFile string, ignoredAPIPathsFile string, goSourcesDir string, oasSpecFile string) *OpenAPISpecCodeDiffsValidator
NewOpenAPISpecCodeDiffsValidator Returns a new OpenAPISpecCodeDiffsValidator
func (*OpenAPISpecCodeDiffsValidator) Validate ¶
func (v *OpenAPISpecCodeDiffsValidator) Validate() (error, OpenAPISpecCodeDiffsResult)
Validate main validation function that sets up the validation tool and returns the diff result