codegen

package
v0.31.3 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 19 Imported by: 8

Documentation

Index

Constants

View Source
const (
	DefaultHeader = "Code generated by skv2. DO NOT EDIT."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// the name of the app or component
	// used to label k8s manifests
	AppName string

	// config to vendor protos and other non-go files
	// Optional: If nil will not be used
	AnyVendorConfig *skv2_anyvendor.Imports

	// Patches to apply to vendored proto files after vendoring
	// Can be used e.g.
	ProtoFilePatches []protovendor.ProtoFilePatcher

	// the k8s api groups for which to compile
	Groups []render.Group

	// protoc cmd line options
	GroupOptions model.GroupOptions

	// top-level custom templates to render.
	// these will recieve all groups as inputs
	TopLevelTemplates []model.CustomTemplates

	// optional helm chart to render
	Chart *model.Chart

	// the root directory for generated Kube manifests
	ManifestRoot string

	// optional Go/Docker images to build
	Builds []model.Build

	// the root directory for Build files (Dockerfile, entrypoint script, etc.)
	BuildRoot string

	// Header to prepend to generated files.
	// If not set will default to: "Code generated by skv2. DO NOT EDIT."
	// The string will auto prepend the comment character depending on the file type it is being written to.
	GeneratedHeader string

	// custom builder to shim Go Build and Docker Build commands (for testing)
	// If not provided, skv2 will exec
	// go and docker commands
	Builder builder.Builder

	// Should we compile protos?
	RenderProtos bool

	// search protos recursively starting from this directory.
	// will default vendor_any if empty
	ProtoDir string

	// protoc cmd line options
	ProtocOptions collector.ProtocOptions

	// Custom go arguments used while compiling protos
	CustomGoArgs []string
	// contains filtered or unexported fields
}

runs the codegen compilation for the current Go module

func (Command) Execute

func (c Command) Execute() error

function to execute skv2 code gen from another repository

Directories

Path Synopsis
test
api/things.test.io/v1
Package v1 contains API Schema definitions for the things.test.io v1 API group +k8s:deepcopy-gen=package,register +groupName=things.test.io
Package v1 contains API Schema definitions for the things.test.io v1 API group +k8s:deepcopy-gen=package,register +groupName=things.test.io
api/things.test.io/v1/controller
Definitions for the Kubernetes Controllers
Definitions for the Kubernetes Controllers
api/things.test.io/v1/controller/mocks
Package mock_controller is a generated GoMock package.
Package mock_controller is a generated GoMock package.
api/things.test.io/v1/mocks
Package mock_v1 is a generated GoMock package.
Package mock_v1 is a generated GoMock package.
api/things.test.io/v1/sets/mocks
Package mock_v1sets is a generated GoMock package.
Package mock_v1sets is a generated GoMock package.
TODO: clean up this file
TODO: clean up this file

Jump to

Keyboard shortcuts

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