const ( OpenApiDir = "openapi" SchemaWriterSrcFileName = "schema_writer_generated.go" OpenApiV2JSON = "openapiv2.json" OpenApiV2YAML = "openapiv2.yaml" )
AssembleAPIDocs copies the generated html files and the static files from srcDir into outputDir
AssembleAPIDocsStatic copies the static files from the referenceDocsRepo to the outputDir. It also downloads from CDN jquery and bootstrap js
DetermineSourceLocation determines the source location for the installed kubernetes-incubator/reference-docs/ The location is based on GOPATH/pkd/mod and the current version.
GenerateAPIDocs runs the apidocs-gen tool against configDirectory which includes the openapi-spec dir, the config.yaml file, static content and the static_includes
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.
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.
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.
GetBoilerplateFile is responsible for canonicalizing the name of the boilerplate file
InstallCodeGenerators installs client-gen from the kubernetes-incubator/reference-docs repository.
InstallGenAPIDocs installs the gen-apidocs tool from the kubernetes-incubator/reference-docs repository.
InstallOpenApiGen installs the openapi-gen tool from the github.com/kubernetes/kube-openapi repository.
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