rndr

package
v0.0.0-...-fdcbe3d Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderPackage

func RenderPackage(ctx context.Context, logger log.Logger, name, author string, s Package, overrOutDir *string) (err error)

RenderPackage renders package.

func RenderTemplate

func RenderTemplate(_ context.Context, logger log.Logger, name string, t Template, valuesYAML []byte, outDir string) (err error)

RenderTemplate renders files based on template and values.

Types

type API

type API struct {
	// One of.
	Go    *golang.TemplateAPI
	Proto *ProtoTemplateAPI
}

type KubeOperatorPackage

type KubeOperatorPackage struct {
}

type OLMPackage

type OLMPackage struct {
}

type OpenshiftTemplatesPackage

type OpenshiftTemplatesPackage struct {
	Values string
}

type Package

type Package struct {
	OutputDir string `yaml:"outputDir"`

	// One of.
	OLM               *OLMPackage
	KubeOperator      *KubeOperatorPackage `yaml:"kubeOperator"`
	Helm              *helm.PackageOptions
	OpenshiftTemplate *OpenshiftTemplatesPackage `yaml:"openshiftTemplate"`
}

type ProcessTemplateRenderer

type ProcessTemplateRenderer struct {
	Command   string
	Arguments []string
	// InputEnvVar controls the name of variable with input YAML content e.g `INPUT`.
	// If empty template input YAML is passed via stdin.
	InputEnvVar string
}

type ProtoTemplateAPI

type ProtoTemplateAPI struct {
	// Message is a name of root proto Message to be assumed as entry point for API in .proto file.
	Message string
	// File is destination to .proto file on local filesystem.
	File string
}

type Spec

type Spec struct {
	Name    string
	Authors string

	Template    *Template
	TemplateRef *TemplateRef

	// Packages is a map of packages made using provided renderable spec.
	Packages map[string]Package
}

Spec specifies the renderable definition file.

func ParseSpec

func ParseSpec(b []byte, dir string) (Spec, error)

ParseSpec parses Spec from bytes. TODO(bwplotka): Version it. TODO(bwplotka): Validate one-offs.

type Template

type Template struct {
	// API is an input definition that will be used to validate template input YAML against or generate
	// required by packaging definitions e.g Custom Resource Definitions for Kubernetes.
	API API

	// Renderer is a mandatory expanding engine that converts input to desired output (e.g as Kubernetes YAMLs)
	Renderer TemplateRenderer
}

type TemplateRef

type TemplateRef struct {
}

type TemplateRenderer

type TemplateRenderer struct {
	// One of.
	// Jsonnet allows to configure a renderer that is able to take jsonnet entry point file and input in YAMl and render output files.
	// `rndr` expects output resources to be rendered in stdout.
	Jsonnet *jsonnet.TemplateRenderer
	// Helm allows to configure a renderer that is able to take helm chart and input in YAMl and render output files.
	Helm *helm.TemplateRenderer
	// Process allows to configure a renderer that is able to execute process with YAMl passed by stdin or envvar and render output files.
	// `rndr` expects output resources to be rendered in stdout.
	Process *ProcessTemplateRenderer
}

Directories

Path Synopsis
engines

Jump to

Keyboard shortcuts

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