Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BundleRenderer ¶
BundleRenderer defines the function signature for rendering a string containing a bundle image/path/file into a DeclarativeConfig fragment It's provided as a discrete type to allow for easy mocking in tests as well as facilitating variable restrictions on reference types
type Factory ¶
type Factory interface {
// CreateTemplate creates a new template instance with the given RenderBundle function
CreateTemplate(renderBundle BundleRenderer) Template
// Schema returns the schema identifier this factory handles
Schema() string
}
Factory creates template instances based on schema
type Template ¶
type Template interface {
// RenderBundle renders a bundle image reference into a DeclarativeConfig fragment.
// This function is used to render a single bundle image reference by a template instance,
// and is provided to the template on construction.
// This is typically used in the call to Render the template to DeclarativeConfig, and
// needs to be configurable to handle different bundle image formats and configurations.
RenderBundle(ctx context.Context, imageRef string) (*declcfg.DeclarativeConfig, error)
// Render processes the raw template yaml/json input and returns an expanded DeclarativeConfig
// in the case where expansion fails, it returns an error
Render(ctx context.Context, reader io.Reader) (*declcfg.DeclarativeConfig, error)
// Schema returns the schema identifier for this template type
Schema() string
}
Template defines the common interface for all template types
Click to show internal directories.
Click to hide internal directories.