limatmpl

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2025 License: Apache-2.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstNameFromImageURL added in v1.1.0

func InstNameFromImageURL(locator, imageArch string) string

func InstNameFromURL

func InstNameFromURL(urlStr string) (string, error)

func InstNameFromYAMLPath

func InstNameFromYAMLPath(yamlPath string) (string, error)

func SeemsFileURL

func SeemsFileURL(arg string) bool

SeemsFileURL returns true if the arg is a URL using the file scheme.

func SeemsHTTPURL

func SeemsHTTPURL(arg string) bool

SeemsHTTPURL returns true if the arg is a URL using the http or https scheme.

func SeemsTemplateURL

func SeemsTemplateURL(arg string) (isTemplate bool, templateName string)

SeemsTemplateURL returns true if the arg is a URL using the template scheme. When it returns true, it also returns the template name.

Types

type Template

type Template struct {
	Locator string // template locator (absolute path or URL)
	Bytes   []byte // file contents

	// The following fields are only used when the template represents a YAML config file.
	Name   string // instance name, may be inferred from locator
	Config *limayaml.LimaYAML
	// contains filtered or unexported fields
}

func Read

func Read(ctx context.Context, name, locator string) (*Template, error)

func (*Template) ClearOnError added in v1.1.0

func (tmpl *Template) ClearOnError(err error) error

func (*Template) Embed added in v1.1.0

func (tmpl *Template) Embed(ctx context.Context, embedAll, defaultBase bool) error

Embed will recursively resolve all "base" dependencies and update the template with the merged result. It also inlines all external provisioning and probe scripts.

func (*Template) Unmarshal added in v1.1.0

func (tmpl *Template) Unmarshal() error

Unmarshal makes sure the tmpl.Config field is set. Any operation that modified tmpl.Bytes is expected to set tmpl.Config back to nil.

func (*Template) UseAbsLocators added in v1.1.0

func (tmpl *Template) UseAbsLocators() error

UseAbsLocators will replace all relative template locators with absolute ones, so this template can be stored anywhere and still reference the same base templates and files.

Jump to

Keyboard shortcuts

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