Documentation ¶
Overview ¶
Package build has functionality for building components, bundles, and component sets from the builder types.
Index ¶
- func AllPatchTemplates(bw *wrapper.BundleWrapper, fopts *filter.Options, opts options.JSONOptions) (*wrapper.BundleWrapper, error)
- func ComponentPatchTemplates(c *bundle.Component, fopts *filter.Options, opts options.JSONOptions) (*bundle.Component, error)
- func PatchTemplate(ptb *bundle.PatchTemplateBuilder, opts options.JSONOptions) (*bundle.PatchTemplate, error)
- type Inliner
- func (n *Inliner) AllComponentFiles(ctx context.Context, cbs []*bundle.ComponentBuilder) ([]*bundle.Component, error)
- func (n *Inliner) BundleFiles(ctx context.Context, data *bundle.BundleBuilder, bundlePath string) (*bundle.Bundle, error)
- func (n *Inliner) ComponentFiles(ctx context.Context, comp *bundle.ComponentBuilder, componentPath string) (*bundle.Component, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllPatchTemplates ¶ added in v0.10.0
func AllPatchTemplates(bw *wrapper.BundleWrapper, fopts *filter.Options, opts options.JSONOptions) (*wrapper.BundleWrapper, error)
AllPatchTemplates is a convenience method to build all PatchTemplateBuilders into PatchTemplates for all Components in a Bundle.
func ComponentPatchTemplates ¶ added in v0.10.0
func ComponentPatchTemplates(c *bundle.Component, fopts *filter.Options, opts options.JSONOptions) (*bundle.Component, error)
ComponentPatchTemplates iterates through all PatchTemplateBuilders in a Components Objects, and converts them into PatchTemplates.
func PatchTemplate ¶ added in v0.10.0
func PatchTemplate(ptb *bundle.PatchTemplateBuilder, opts options.JSONOptions) (*bundle.PatchTemplate, error)
PatchTemplate renders a PatchTemplate from a PatchTemplateBuilder and options.
If the PatchTemplateBuilder has the annotation `bundle.gke.io/safe-yaml`, then yaml-templater will use safe-yaml templater.
Types ¶
type Inliner ¶
type Inliner struct { // Readers reads from the local filesystem. Readers map[files.URLScheme]files.FileObjReader }
Inliner inlines data files by reading them from the local or a remote filesystem.
func NewInlinerWithScheme ¶
func NewInlinerWithScheme(scheme files.URLScheme, objReader files.FileObjReader) *Inliner
NewInlinerWithScheme creates a new inliner given a URL scheme.
func NewLocalInliner ¶
NewLocalInliner creates a new inliner that only knows how to read local files from disk. If the data is stored on disk, the cwd should be the path to the directory containing the data file on disk. Relative paths are not supported.
func (*Inliner) AllComponentFiles ¶
func (n *Inliner) AllComponentFiles(ctx context.Context, cbs []*bundle.ComponentBuilder) ([]*bundle.Component, error)
AllComponentFiles is a convenience method for inlining multiple component files.
func (*Inliner) BundleFiles ¶
func (n *Inliner) BundleFiles(ctx context.Context, data *bundle.BundleBuilder, bundlePath string) (*bundle.Bundle, error)
BundleFiles inlines file-references in for bundle files. If the bundlePath is defined and not absolute and the scheme is file based scheme, then the path is made absolute before proceeding.
func (*Inliner) ComponentFiles ¶
func (n *Inliner) ComponentFiles(ctx context.Context, comp *bundle.ComponentBuilder, componentPath string) (*bundle.Component, error)
ComponentFiles reads file-references for component builder objects. The returned components are copies with the file-references removed. If the componentPath is not absolute and the scheme is a file scheme, it will be made absolute before proceeding.