template

package
v0.9.1-33-g352158fe Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

Package template implements the interface through which templates can be edited and configured.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TransformFromSchema added in v0.7.0

func TransformFromSchema(ctx context.Context, props interface{}) (interface{}, error)

TransformFromSchema parses an input schema and returns an instantiated TemplateConfig

Types

type Template

type Template interface {
	component.Component
}

Template interfaces with the standard component in Unikraft

func NewTemplateFromOptions added in v0.5.1

func NewTemplateFromOptions(opts ...TemplateOption) (Template, error)

NewTemplateFromOptions creates a new template configuration

type TemplateConfig

type TemplateConfig struct {
	// contains filtered or unexported fields
}

TemplateConfig is the configuration of a template. It is identical to the component configuration

func (TemplateConfig) KConfig added in v0.4.0

func (tc TemplateConfig) KConfig() kconfig.KeyValueMap

func (TemplateConfig) KConfigTree added in v0.4.0

KConfigTree returns the path to the kconfig file of the template

func (TemplateConfig) MarshalYAML added in v0.6.4

func (tc TemplateConfig) MarshalYAML() (interface{}, error)

func (TemplateConfig) Name

func (tc TemplateConfig) Name() string

Name returns the name of the template

func (TemplateConfig) Path added in v0.4.0

func (tc TemplateConfig) Path() string

func (TemplateConfig) PrintInfo

func (tc TemplateConfig) PrintInfo(ctx context.Context) string

PrintInfo prints information about the template

func (TemplateConfig) Source

func (tc TemplateConfig) Source() string

Source returns the source of the template

func (TemplateConfig) String added in v0.7.0

func (tc TemplateConfig) String() string

func (TemplateConfig) Type

Type returns the type of the template

func (TemplateConfig) Version

func (tc TemplateConfig) Version() string

Version returns the version of the template

type TemplateOption added in v0.5.1

type TemplateOption func(*TemplateConfig) error

TemplateOption is a function that modifies a TemplateConfig.

func WithName added in v0.5.1

func WithName(name string) TemplateOption

WithName sets the name of the template.

func WithSource added in v0.5.1

func WithSource(source string) TemplateOption

WithSource sets the source of the template.

func WithVersion added in v0.5.1

func WithVersion(version string) TemplateOption

WithVersion sets the version of the template.

Jump to

Keyboard shortcuts

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