model

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Project

type Project struct {
	// snapshots will be built from the set of API Groups contained here.
	// map key should be the name of the go module containing the API Group.
	// for API Groups defined in the local repository, the go module should be left as empty string ""
	SnapshotApiGroups map[string][]model.Group

	// The set of components to be generated for this Project
	TopLevelComponents []TopLevelComponent
}

encapsulates the top level templates command for the entire project

func (Project) TopLevelTemplates

func (p Project) TopLevelTemplates() []model.CustomTemplates

Build the top level templates for the project

type TopLevelComponent

type TopLevelComponent struct {
	// path where the generated top-level component's code will be placed.
	// input snapshots will live in <GeneratedCodeRoot>/input/snapshot.go
	// input reconcilers will live in <GeneratedCodeRoot>/input/reconciler.go
	// output snapshots will live in <GeneratedCodeRoot>/output/snapshot.go
	GeneratedCodeRoot string

	// the set of input resources for which to generate a snapshot and reconciler
	// local inptus are read from the local cluster where the controller runs
	LocalInputResources io.Snapshot
	// remote inptus are read from managed cluster registered to the controller cluster
	RemoteInputResources io.Snapshot

	// name of the local snapshot, if the component is hybrid. defaults to Local
	LocalSnapshotName string

	// name of the remote snapshot, if the component is hybrid. defaults to Remote
	RemoteSnapshotName string

	// if this component can run in agent mode, generate a homogenous reconciler which combines both the local and remote resources
	AgentMode bool

	// the set of output resources for which to generate a snapshot
	OutputResources []io.OutputSnapshot
}

generates an input snapshot, input reconciler, and output snapshot for each top-level component. top-level components are defined by mapping a given set of inputs to outputs.

func (TopLevelComponent) MakeCodegenTemplates

func (t TopLevelComponent) MakeCodegenTemplates(snapshotApiGroups map[string][]model.Group) []model.CustomTemplates

Jump to

Keyboard shortcuts

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