Documentation ¶
Index ¶
- Constants
- func AssembleAPIDocs(srcDir string, outputDir string) error
- func AssembleAPIDocsStatic(referenceDocsRepo string, outputDir string) error
- func DetermineSourceLocation(moduleDir string, gopath string) (string, error)
- func GenerateAPIDocs(configDir string, gopath string) error
- func GenerateClient(generators []string, groupsWithVersions []string, inputPackage string, ...) error
- func GenerateOpenApi(groupsWithVersions []string, inputPackage string, outputPackage string, ...) error
- func GenerateSchema(outputDir string, inputPackage string, inputBase string, title string, ...) error
- func GetBoilerplateFile(fileName string) (string, error)
- func InstallCodeGenerators(version string, gopath string) error
- func InstallGenAPIDocs(version string, gopath string) error
- func InstallOpenApiGen(version string, gopath string) error
- func WriteSchemaToDisk(outputDir string, title string, version string, ...) error
Constants ¶
const ( OpenApiDir = "openapi" SchemaWriterSrcFileName = "schema_writer_generated.go" OpenApiV2JSON = "openapiv2.json" OpenApiV2YAML = "openapiv2.yaml" )
Variables ¶
This section is empty.
Functions ¶
func AssembleAPIDocs ¶
AssembleAPIDocs copies the generated html files and the static files from srcDir into outputDir
func AssembleAPIDocsStatic ¶
AssembleAPIDocsStatic copies the static files from the referenceDocsRepo to the outputDir. It also downloads from CDN jquery and bootstrap js
func DetermineSourceLocation ¶
DetermineSourceLocation determines the source location for the installed kubernetes-incubator/reference-docs/ The location is based on GOPATH/pkd/mod and the current version.
func GenerateAPIDocs ¶
GenerateAPIDocs runs the apidocs-gen tool against configDirectory which includes the openapi-spec dir, the config.yaml file, static content and the static_includes
func GenerateClient ¶
func GenerateClient(generators []string, groupsWithVersions []string, inputPackage string, outputPackage string, relativePackage string, outputBase string, boilerplateFile string, gopath string, semVer string) error
GenerateClient runs the generators specified. It looks at the specified groupsWithVersions in inputPackage and generates to outputPackage ( // relative to the module outputBase). A boilerplateFile is written to the top of any generated files.
func GenerateOpenApi ¶
func GenerateOpenApi(groupsWithVersions []string, inputPackage string, outputPackage string, relativePackage string, outputBase string, openApiDependencies []string, moduleDir string, moduleName string, boilerplateFile string, gopath string, semVer string) error
GenerateOpenApi generates the OpenAPI structs and schema files. It looks at the specified groupsWithVersions in inputPackage and generates to outputPackage ( relative to the module outputBase). Any openApiDependencies also have OpenAPI structs generated. A boilerplateFile is written to the top of any generated files. The gitter client is used to ensure the correct versions of dependencies are loaded.
func GenerateSchema ¶
func GenerateSchema(outputDir string, inputPackage string, inputBase string, title string, version string, gopath string) error
GenerateSchema calls the generated schema writer and then loads the output and also writes out a yaml version. The outputDir is the base directory for writing the schemas to (they get put in the openapi-spec subdir), inputPackage is the package in which generated code lives, inputBase is the path to the module, title and version are used in the OpenAPI spec files.
func GetBoilerplateFile ¶
GetBoilerplateFile is responsible for canonicalizing the name of the boilerplate file
func InstallCodeGenerators ¶
InstallCodeGenerators installs client-gen from the kubernetes-incubator/reference-docs repository.
func InstallGenAPIDocs ¶
InstallGenAPIDocs installs the gen-apidocs tool from the kubernetes-incubator/reference-docs repository.
func InstallOpenApiGen ¶
InstallOpenApiGen installs the openapi-gen tool from the github.com/kubernetes/kube-openapi repository.
func WriteSchemaToDisk ¶
func WriteSchemaToDisk(outputDir string, title string, version string, definitions common.GetOpenAPIDefinitions, names []string) error
WriteSchemaToDisk is called by the code generated main function to marshal the contents of the OpenAPI structs and write them to disk. outputDir is the dir to write the json and yaml files to, you can also provide the title and version for the OpenAPI spec. definitions is the function that returns all the openapi definitions. WriteSchemaToDisk will rewrite the definitions to a dot-separated notation, reversing the initial domain name
Types ¶
This section is empty.