translator

package
v0.0.0-...-ece56c8 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInput

func NewInput(component hpsf.Component) (config.Component, error)

Types

type SubstitutionContext

type SubstitutionContext map[string]string

type Substitutor

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

func NewSubstitutor

func NewSubstitutor() *Substitutor

func (*Substitutor) AddContext

func (s *Substitutor) AddContext(name string, context SubstitutionContext, priority int)

AddContext adds an entire new context to the substitutor. The context is a map of key-value pairs that will be used for substitutions.

func (*Substitutor) AddSubstitution

func (s *Substitutor) AddSubstitution(ctx, key, value string)

AddSubstitution adds a single key-value pair to a context. If the context doesn't exist, it will be created.

func (*Substitutor) DoSubstitutions

func (s *Substitutor) DoSubstitutions(input string) string

func (*Substitutor) SetPriority

func (s *Substitutor) SetPriority(name string, priority int)

type Translator

type Translator struct {
}

func NewTranslator

func NewTranslator() *Translator

func (*Translator) GenerateConfig

func (t *Translator) GenerateConfig(h *hpsf.HPSF, ct config.Type) (yaml.DottedConfig, error)

func (*Translator) MakeConfigComponent

func (t *Translator) MakeConfigComponent(component hpsf.Component) (config.Component, error)

Jump to

Keyboard shortcuts

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