render

package
v0.0.0-...-f46a14b Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExtPrefix    = "extensions"
	CustomPrefix = "_custom"
	GenPrefix    = "_gen"
	GenExt       = ".libsonnet"
	IndexFile    = "gen" + GenExt
	MainFile     = "main" + GenExt
)

Common set of directory structure / file extensions

View Source
const (
	// LocalAPIVersion references a "private: json field containing the APIVersion
	LocalAPIVersion = "_apiVersion"
)

Variables

This section is empty.

Functions

func Index

func Index(groups map[string]model.Group, name, repo, dir, description string) j.ObjectType

Index creates gen.libsonnet, the index of all generated artifacts

func Kind

func Kind(name string, k model.Kind) j.ObjectType

Kind renders the given Kind, including all modifiers and perhaps a constructor

func Main

func Main(adds []string) j.Type

Main creates main.libsonnet: - import the generated index (gen.libsonnet) - add all hand-written patches on top

func Modifier

func Modifier(name string, i interface{}) []j.Type

Modifier retrieves the correct modifier(s) for a given type

func SortFields

func SortFields(fields []j.Type)

SortFields sorts Jsonnet fields

Types

type Objects

type Objects map[string]j.ObjectType

Objects is a collection of Jsonnet objects, indexed by their expected path on the filesystem

func Group

func Group(name string, g model.Group) Objects

Group renders the entire given group, returning e.g.: - main.libsonnet, the group index - v1/main.libsonnet, the version v1 index - v1/deployment.libsonnet, Deployment - v1/daemonset.libsonnet, DaemonSet

func Version

func Version(name string, v model.Version) Objects

Version renders the entire given object, returning e.g.: - /main.libsonnet, the version index - /deployment.libsonnet, Deployment - /daemonset.libsonnet, DaemonSet

func (Objects) Add

func (o Objects) Add(prefix string, set Objects)

Add appends a jsonnet object to an object

Jump to

Keyboard shortcuts

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