Documentation
¶
Index ¶
- Constants
- Variables
- func FetchAPIDefinition(d string) []byte
- func FormatToGolangDeprecatedVarNameAndValue(sr ScrapeResult) string
- func FormatToGolangVarName(sr ScrapeResult) string
- func FormatToGolangVarNameAndValue(sr ScrapeResult) string
- func OpenAPIURLs(version string) (standard, enterprise string)
- func ReadOpenAPIVersion() (string, error)
- func VarNameFromScrapeResult(sr ScrapeResult) string
- type ScrapeResult
Constants ¶
View Source
const ( OptionalLastParameter = "{%s:.*}" ExtendedLastParameter = "{%s:.+}" )
View Source
const DEPRECATED_OUTPUT_FILEPATH = "src/mock/deprecated.go"
View Source
const DEPRECATED_OUTPUT_FILE_HEADER = `` /* 182-byte string literal not displayed */
View Source
const GITHUB_OPENAPI_VERSION_FILE = ".github_openapi_version"
View Source
const OUTPUT_FILEPATH = "src/mock/endpointpattern.go"
View Source
const OUTPUT_FILE_HEADER = `package mock
// Code generated; DO NOT EDIT.
`
Variables ¶
View Source
var Title = cases.Title(language.English)
Replacing deprecated method strings.Title requires a "Caser"
Functions ¶
func FetchAPIDefinition ¶
func FormatToGolangDeprecatedVarNameAndValue ¶
func FormatToGolangDeprecatedVarNameAndValue(sr ScrapeResult) string
func FormatToGolangVarName ¶
func FormatToGolangVarName(sr ScrapeResult) string
FormatToGolangVarName generated the proper golang variable name given a endpoint format from the API
func FormatToGolangVarNameAndValue ¶
func FormatToGolangVarNameAndValue(sr ScrapeResult) string
func OpenAPIURLs ¶
OpenAPIURLs returns the standard and enterprise OpenAPI spec URLs for the given version tag.
func ReadOpenAPIVersion ¶
ReadOpenAPIVersion reads the pinned OpenAPI spec version from GITHUB_OPENAPI_VERSION_FILE.
func VarNameFromScrapeResult ¶
func VarNameFromScrapeResult(sr ScrapeResult) string
VarNameFromScrapeResult returns the Go variable name for a ScrapeResult, applying any mutations first. Use this for deduplication before deciding which output buffer to write to.
Types ¶
type ScrapeResult ¶
Click to show internal directories.
Click to hide internal directories.