template

package
v1.108.10 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 49 Imported by: 8

Documentation

Index

Constants

View Source
const (
	DefaultCharset = "[_A-Za-z0-9]"
)

Variables

View Source
var (
	// TestingDisableKurlValues should be set to true for testing purposes only.
	// This disables the need for a Kubernetes cluster when running unit tests.
	TestingDisableKurlValues = false
)

Functions

func InstallationSpecFromVersionInfo added in v1.100.1

func InstallationSpecFromVersionInfo(info *VersionInfo) v1beta1.InstallationSpec

Types

type ApplicationInfo

type ApplicationInfo struct {
	Slug string
}

type Builder

type Builder struct {
	Ctx    []Ctx
	Functs template.FuncMap
}

func NewBuilder

func NewBuilder(opts BuilderOptions) (Builder, map[string]ItemValue, error)

NewBuilder creates a builder with all available contexts.

func (*Builder) AddCtx

func (b *Builder) AddCtx(ctx Ctx)

func (*Builder) Bool

func (b *Builder) Bool(text string, defaultVal bool) (bool, error)

func (*Builder) BuildFuncMap

func (b *Builder) BuildFuncMap() template.FuncMap

func (*Builder) Float64

func (b *Builder) Float64(text string, defaultVal float64) (float64, error)

func (*Builder) GetTemplate

func (b *Builder) GetTemplate(name, text string, rdelim, ldelim string) (*template.Template, error)

func (*Builder) Int

func (b *Builder) Int(text string, defaultVal int64) (int64, error)

func (*Builder) RenderTemplate

func (b *Builder) RenderTemplate(name string, text string) (string, error)

func (*Builder) String

func (b *Builder) String(text string) (string, error)

func (*Builder) Uint

func (b *Builder) Uint(text string, defaultVal uint64) (uint64, error)

type BuilderOptions

type BuilderOptions struct {
	ConfigGroups    []kotsv1beta1.ConfigGroup
	ExistingValues  map[string]ItemValue
	LocalRegistry   registrytypes.RegistrySettings
	License         *kotsv1beta1.License
	Application     *kotsv1beta1.Application
	ApplicationInfo *ApplicationInfo
	VersionInfo     *VersionInfo
	IdentityConfig  *kotsv1beta1.IdentityConfig
	Namespace       string
	DecryptValues   bool
}

type ConfigCtx

type ConfigCtx struct {
	ItemValues        map[string]ItemValue
	LocalRegistry     registrytypes.RegistrySettings
	DockerHubRegistry dockerregistrytypes.RegistryOptions
	VersionInfo       *VersionInfo
	AppSlug           string
	DecryptValues     bool
	// contains filtered or unexported fields
}

ConfigCtx is the context for builder functions before the application has started.

func (ConfigCtx) FuncMap

func (ctx ConfigCtx) FuncMap() template.FuncMap

FuncMap represents the available functions in the ConfigCtx.

type Ctx

type Ctx interface {
	FuncMap() template.FuncMap
}

type ItemValue

type ItemValue struct {
	Value          interface{}
	Default        interface{}
	Filename       string
	RepeatableItem string
}

func (ItemValue) DefaultStr

func (i ItemValue) DefaultStr() string

func (ItemValue) HasDefault

func (i ItemValue) HasDefault() bool

func (ItemValue) HasValue

func (i ItemValue) HasValue() bool

func (ItemValue) ValueStr

func (i ItemValue) ValueStr() string

type StaticCtx

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

func (StaticCtx) FuncMap

func (ctx StaticCtx) FuncMap() template.FuncMap

func (*StaticCtx) RandomBytes

func (ctx *StaticCtx) RandomBytes(length uint64) string

RandomBytes returns a base64-encoded byte array allowing the full range of byte values.

type TLSPair

type TLSPair struct {
	Cert string
	Key  string
	Cn   string
}

type VersionInfo

type VersionInfo struct {
	Sequence                 int64  // the installation sequence. Always 0 when being freshly installed, etc
	Cursor                   string // the upstream version cursor - integers for kots apps, may be semvers for helm charts
	ChannelName              string // the name of the channel that the current version was from
	VersionLabel             string // a pretty version label if provided
	IsRequired               bool   // is the version/release required during upgrades or can it be skipped
	ReleaseNotes             string // the release notes for the given version
	IsAirgap                 bool   // is this an airgap app
	ReplicatedRegistryDomain string // the custom domain for the replicated registry
	ReplicatedProxyDomain    string // the custom domain for the replicated proxy
}

func VersionInfoFromInstallationSpec added in v1.100.1

func VersionInfoFromInstallationSpec(sequence int64, isAirgap bool, spec v1beta1.InstallationSpec) VersionInfo

Jump to

Keyboard shortcuts

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