gen

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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

Replacing deprecated method strings.Title requires a "Caser"

Functions

func FetchAPIDefinition

func FetchAPIDefinition(d string) []byte

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

func OpenAPIURLs(version string) (standard, enterprise string)

OpenAPIURLs returns the standard and enterprise OpenAPI spec URLs for the given version tag.

func ReadOpenAPIVersion

func ReadOpenAPIVersion() (string, error)

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

type ScrapeResult struct {
	HTTPMethod      string
	EndpointPattern string
}

Jump to

Keyboard shortcuts

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