Documentation
¶
Index ¶
- Constants
- func FindTokens(input string) []string
- func KubeControllerSpecHelper[T any](inputType T, cm CMRetrieveWithInputReplacediface, ...) (*T, error)deprecated
- func RetrieveMarshalledJson[T any](input *T, cm CMRetrieveWithInputReplacediface, config generator.GenVarsConfig) (*T, error)
- func RetrieveMarshalledYaml[T any](input *T, cm CMRetrieveWithInputReplacediface, config generator.GenVarsConfig) (*T, error)
- func RetrieveUnmarshalledFromJson[T any](input []byte, output *T, cm CMRetrieveWithInputReplacediface, ...) (*T, error)
- func RetrieveUnmarshalledFromYaml[T any](input []byte, output *T, cm CMRetrieveWithInputReplacediface, ...) (*T, error)
- type CMRetrieveWithInputReplacediface
- type ConfigManager
- type GenerateAPI
Constants ¶
const (
TERMINATING_CHAR string = `[^\'\"\s\n\\\,]`
)
Variables ¶
This section is empty.
Functions ¶
func FindTokens ¶ added in v1.18.2
FindTokens extracts all replaceable tokens from a given input string
func KubeControllerSpecHelper
deprecated
added in
v1.8.0
func KubeControllerSpecHelper[T any](inputType T, cm CMRetrieveWithInputReplacediface, config generator.GenVarsConfig) (*T, error)
KubeControllerSpecHelper is a helper method, it marshalls an input value of that type into a string and passes it into the relevant configmanger retrieve method and returns the unmarshalled object back.
It accepts a DI of configmanager and the config (for testability) to replace all occurences of replaceable tokens inside a Marshalled string of that type ¶
Deprecated: Left for compatibility reasons
func RetrieveMarshalledJson ¶ added in v1.9.0
func RetrieveMarshalledJson[T any](input *T, cm CMRetrieveWithInputReplacediface, config generator.GenVarsConfig) (*T, error)
RetrieveMarshalledJson is a helper method.
It marshalls an input value of that type into a []byte and passes it into the relevant configmanger retrieve method returns the unmarshalled object back with all tokens replaced IF found for their specific vault implementation values. Type must contain all public members with a JSON tag on the struct
func RetrieveMarshalledYaml ¶ added in v1.9.0
func RetrieveMarshalledYaml[T any](input *T, cm CMRetrieveWithInputReplacediface, config generator.GenVarsConfig) (*T, error)
RetrieveMarshalledYaml is a helper method.
It marshalls an input value of that type into a []byte and passes it into the relevant configmanger retrieve method returns the unmarshalled object back with all tokens replaced IF found for their specific vault implementation values. Type must contain all public members with a YAML tag on the struct
func RetrieveUnmarshalledFromJson ¶ added in v1.9.0
func RetrieveUnmarshalledFromJson[T any](input []byte, output *T, cm CMRetrieveWithInputReplacediface, config generator.GenVarsConfig) (*T, error)
RetrieveUnmarshalledFromJson is a helper method. Same as RetrieveMarshalledJson but it accepts an already marshalled byte slice
func RetrieveUnmarshalledFromYaml ¶ added in v1.9.0
func RetrieveUnmarshalledFromYaml[T any](input []byte, output *T, cm CMRetrieveWithInputReplacediface, config generator.GenVarsConfig) (*T, error)
RetrieveUnmarshalledFromYaml is a helper method.
Same as RetrieveMarshalledYaml but it accepts an already marshalled byte slice
Types ¶
type CMRetrieveWithInputReplacediface ¶ added in v1.12.0
type CMRetrieveWithInputReplacediface interface {
RetrieveWithInputReplaced(input string, config generator.GenVarsConfig) (string, error)
}
type ConfigManager ¶
type ConfigManager struct{}
func (*ConfigManager) Retrieve ¶
func (c *ConfigManager) Retrieve(tokens []string, config generator.GenVarsConfig) (generator.ParsedMap, error)
Retrieve gets a rawMap from a set implementation will be empty if no matches found
func (*ConfigManager) RetrieveWithInputReplaced ¶ added in v1.0.1
func (c *ConfigManager) RetrieveWithInputReplaced(input string, config generator.GenVarsConfig) (string, error)
RetrieveWithInputReplaced parses given input against all possible token strings using regex to grab a list of found tokens in the given string and returns the replaced string