template_engine

package
v0.0.0-...-ba64992 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotExists = errors.New("not exists")

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// If strict is enabled, template rendering will fail if a template references
	// a value that was not passed in.
	Strict bool
	// In LintMode, some 'required' template values may be missing, so don't fail
	LintMode bool
}

Engine is an implementation of the Helm rendering implementation for templates.

func NewEngine

func NewEngine() *Engine

func (*Engine) Render

func (e *Engine) Render(mainTemplate string, referencedTemplates map[string]string, values interface{}) (rendered string, err error)

Render takes a map of templates/values to render, and a map of templates which can be referenced within them.

type EventData

type EventData = map[string]any

type I18nRawMap

type I18nRawMap map[string]map[string]string

func (I18nRawMap) Locale

func (m I18nRawMap) Locale(locale string) map[string]string

type I18nStore

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

func NewI18nStore

func NewI18nStore() *I18nStore

func (*I18nStore) LoadMessages

func (s *I18nStore) LoadMessages(locale string, data map[string]string) error

func (*I18nStore) ResolveMessage

func (s *I18nStore) ResolveMessage(locale string, name string, arguments map[string]any) (string, error)

func (*I18nStore) SetFallbackLocale

func (s *I18nStore) SetFallbackLocale(locale string)

type Renderable

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

type RootContext

type RootContext struct {
	Subscriber api_model.Subscriber `json:"subscriber"`
	Tenant     api_model.Tenant     `json:"tenant"`
	Step       Step                 `json:"step"`
	// contains filtered or unexported fields
}

func NewRootContext

func NewRootContext(i18nStore *I18nStore) *RootContext

type Step

type Step struct {
	Digest     bool        `bson:"digest"`
	Events     []EventData `bson:"events"`
	TotalCount int         `bson:"totalCount"`
}

Jump to

Keyboard shortcuts

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