jx: github.com/jenkins-x/jx/cmd/codegen/generator Index | Files

package generator

import "github.com/jenkins-x/jx/cmd/codegen/generator"

Index

Package Files

client_set.go common.go docs.go open_api.go

Constants

const (
    OpenApiDir              = "openapi"
    SchemaWriterSrcFileName = "schema_writer_generated.go"
    OpenApiV2JSON           = "openapiv2.json"
    OpenApiV2YAML           = "openapiv2.yaml"
)

func AssembleAPIDocs Uses

func AssembleAPIDocs(srcDir string, outputDir string) error

AssembleAPIDocs copies the generated html files and the static files from srcDir into outputDir

func AssembleAPIDocsStatic Uses

func AssembleAPIDocsStatic(referenceDocsRepo string, outputDir string) error

AssembleAPIDocsStatic copies the static files from the referenceDocsRepo to the outputDir. It also downloads from CDN jquery and bootstrap js

func DetermineSourceLocation Uses

func DetermineSourceLocation(moduleDir string, gopath string) (string, error)

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 Uses

func GenerateAPIDocs(configDir string, gopath string) error

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 Uses

func GenerateClient(generators []string, groupsWithVersions []string, inputPackage string, outputPackage string,
    outputBase string, boilerplateFile string, gopath 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 Uses

func GenerateOpenApi(groupsWithVersions []string, inputPackage string, outputPackage string, relativePackage string,
    outputBase string, openApiDependencies []string, moduleDir string, moduleName string, boilerplateFile string, gopath 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 Uses

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 Uses

func GetBoilerplateFile(fileName string) (string, error)

GetBoilerplateFile is responsible for canonicalizing the name of the boilerplate file

func InstallCodeGenerators Uses

func InstallCodeGenerators(version string, gopath string) error

InstallCodeGenerators installs client-gen from the kubernetes-incubator/reference-docs repository.

func InstallGenAPIDocs Uses

func InstallGenAPIDocs(version string, gopath string) error

InstallGenAPIDocs installs the gen-apidocs tool from the kubernetes-incubator/reference-docs repository.

func InstallOpenApiGen Uses

func InstallOpenApiGen(version string, gopath string) error

InstallOpenApiGen installs the openapi-gen tool from the github.com/kubernetes/kube-openapi repository.

func WriteSchemaToDisk Uses

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

Package generator imports 19 packages (graph) and is imported by 2 packages. Updated 2019-09-16. Refresh now. Tools for package owners.