generator

package
v2.1.10 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsParsed

func IsParsed(v any, trm ParsedMap) bool

IsParsed will try to parse the return found string into map[string]string If found it will convert that to a map with all keys uppercased and any characters

Types

type GenVars

type GenVars struct {
	Logger log.ILogger
	// contains filtered or unexported fields
}

GenVars is the main struct holding the strategy patterns iface any initialised config if overridded with withers as well as the final outString and the initial rawMap which wil be passed in a loop into a goroutine to perform the relevant strategy network calls to the config store implementations

func NewGenerator

func NewGenerator(ctx context.Context, opts ...Opts) *GenVars

NewGenerator returns a new instance of Generator with a default strategy pattern wil be overwritten during the first run of a found tokens map

func (*GenVars) Config

func (c *GenVars) Config() *config.GenVarsConfig

Config gets Config on the GenVars

func (*GenVars) Generate

func (c *GenVars) Generate(tokens []string) (ParsedMap, error)

Generate generates a k/v map of the tokens with their corresponding secret/paramstore values the standard pattern of a token should follow a path like string

func (*GenVars) WithConfig

func (c *GenVars) WithConfig(cfg *config.GenVarsConfig) *GenVars

WithConfig uses custom config

func (*GenVars) WithContext

func (c *GenVars) WithContext(ctx context.Context) *GenVars

WithContext uses caller passed context

func (*GenVars) WithStrategyMap

func (c *GenVars) WithStrategyMap(sm strategy.StrategyFuncMap) *GenVars

WithStrategyMap

Adds addtional funcs for storageRetrieval used for testing only

type Opts

type Opts func(*GenVars)

type ParsedMap

type ParsedMap map[string]any

ParsedMap is the internal working object definition and the return type if results are not flushed to file

func (ParsedMap) MapKeys

func (pm ParsedMap) MapKeys() (keys []string)

Jump to

Keyboard shortcuts

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