gen

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OptionalLastParameter = "{%s:.*}"
	ExtendedLastParameter = "{%s:.+}"
)
View Source
const GITHUB_OPENAPI_DEFINITION_LOCATION = "https://github.com/github/rest-api-description/blob/main/descriptions/api.github.com/api.github.com.json?raw=true"
View Source
const GITHUB_OPENAPI_ENTERPRISE_DEFINITION_LOCATION = "https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/ghec/ghec.json"
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 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

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