{"modulePath":"github.com/RHEcosystemAppEng/openapi_spec_code_diffs","version":"v0.0.0-20230724204053-5d48a221f0e6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package validator\n\n## Functions\n\n```go\nfunc NewGoLangSourceFileReader(fileName string, ignoredLines *IgnoredLines) *golangSourceFileReader\n```\nNewGoLangSourceFileReader Returns a new golangSourceFileReader\n\n```go\nfunc NewGoSourceAPILine(fileName string, fullLine string, lineNum int, httpMethod string, apiPath string) *goSourceAPILine\n```\nNewGoSourceAPILine Returns a new goSourceAPILine\n\n```go\nfunc NewOASModel(specFile string) *oasModel\n```\nNewOASModel Returns a new oasModel\n\n```go\nfunc ReadFile(filename string) (error, []string)\n```\nReadFile Reads file contents and returns its contents as an array of strings.\n\n## Types\n\n```go\ntype DiffWorker struct {\n\t// contains filtered or unexported fields\n}\n```\nDiffWorker Structure for use as inputs by diff worker, consisting of definitions found in code, specs and api definitions to be ignored\n\n```go\nfunc NewDiffWorker(codeAPIDefs []*goSourceAPILine, specAPIDefs []string, ignoredAPIDefs *IgnoredAPIPaths) *DiffWorker\n```\nNewDiffWorker Returns a new DiffWorker\n\n```go\nfunc (v *DiffWorker) ValidateCodeDefsNotInSpec() (error, []string)\n```\nValidateCodeDefsNotInSpec Returns api paths found in code but not defined in spec\n\n```go\nfunc (v *DiffWorker) ValidateSpecDefsNotInCode() (error, []string)\n```\nValidateSpecDefsNotInCode Returns api paths defined in spec but not found in code\n\n```go\ntype GoSourceScanner struct {\n\t// contains filtered or unexported fields\n}\n```\nGoSourceScanner Structure to specify root golang source directory and directories/files/lines to be ignored for scanning of API path definitions\n\n```go\nfunc NewGoSourceScanner(dir string, ignoredDirectories *IgnoredDirectories, ignoredFiles *IgnoredFiles, ignoredLines *IgnoredLines) *GoSourceScanner\n```\nNewGoSourceScanner Returns a new GoSourceScanner\n\n```go\nfunc (gss *GoSourceScanner) ScanSourcesForAPIDefs() (error, []*goSourceAPILine)\n```\nScanSourcesForAPIDefs 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\n\n```go\ntype IgnoredAPIPaths struct {\n\t// contains filtered or unexported fields\n}\n```\nIgnoredAPIPaths Array of API paths to be ignored while working out diffs between code and specs\n\n```go\nfunc NewIgnoredAPIRoutes(ignoredAPIPathsFile string) (error, *IgnoredAPIPaths)\n```\nNewIgnoredAPIRoutes Returns a new IgnoredAPIPaths\n\n```go\ntype IgnoredDirectories struct {\n\t// contains filtered or unexported fields\n}\n```\nIgnoredDirectories Directories to be ignored while coming up with diffs e.g. /bin, /out\n\n```go\nfunc NewIgnoredDirectories(ignoreDirFileName string) (error, *IgnoredDirectories)\n```\nNewIgnoredDirectories Returns new IgnoredDirectories\n\n```go\ntype IgnoredFiles struct {\n\t// contains filtered or unexported fields\n}\n```\nIgnoredFiles Files to be ignored while coming up with diffs\n\n```go\nfunc NewIgnoredFiles(ignoreFilesFileName string) (error, *IgnoredFiles)\n```\nNewIgnoredFiles Returns new IgnoredFiles\n\n```go\ntype IgnoredLines struct {\n\t// contains filtered or unexported fields\n}\n```\nIgnoredLines Files to be ignored while coming up with diffs\n\n```go\nfunc NewIgnoredLines(ignoredLinesFileName string) (error, *IgnoredLines)\n```\nNewIgnoredLines Returns new IgnoredLines\n\n```go\ntype OpenAPISpecCodeDiffsResult struct {\n\tSpecDefsNotInCode []string\n\tCodeDefsNotSpec   []string\n}\n```\nOpenAPISpecCodeDiffsResult Represents results of diff operation between golang source code and OpenAPI Specs\n\n```go\ntype OpenAPISpecCodeDiffsValidator struct {\n\t// contains filtered or unexported fields\n}\n```\nOpenAPISpecCodeDiffsValidator The main input struct for this validation tool\n\n```go\nfunc NewOpenAPISpecCodeDiffsValidator(ignoredDirFile string, ignoredFilesFile string, ignoredLinesFile string, ignoredAPIPathsFile string, goSourcesDir string, oasSpecFile string) *OpenAPISpecCodeDiffsValidator\n```\nNewOpenAPISpecCodeDiffsValidator Returns a new OpenAPISpecCodeDiffsValidator\n\n```go\nfunc (v *OpenAPISpecCodeDiffsValidator) Validate() (error, OpenAPISpecCodeDiffsResult)\n```\nValidate main validation function that sets up the validation tool and returns the diff result\n\n","path":"github.com/RHEcosystemAppEng/openapi_spec_code_diffs/validator","name":"validator","synopsis":"","isRedistributable":true}
