params

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: Apache-2.0 Imports: 13 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendComponent

func AppendComponent(component, snippet string, params Params) (string, error)

AppendComponent takes the following params

component: the name of the new component to be added.
snippet: a jsonnet snippet resembling the current component parameters.
params: the parameters for the new component.

and returns the jsonnet snippet with the appended component and parameters.

func DeleteComponent added in v0.9.0

func DeleteComponent(component, snippet string) (string, error)

DeleteComponent takes

component: the name of the component to be deleted.
snippet: a jsonnet snippet resembling the current component parameters.

and returns the jsonnet snippet with the removed component.

func DeleteEnvironmentParam added in v0.10.0

func DeleteEnvironmentParam(componentName, paramName, snippet string) (string, error)

DeleteEnvironmentParam deletes a parameter for an environment param file. It returns the updated snippet.

func GetAllComponentParams

func GetAllComponentParams(snippet string) (map[string]Params, error)

GetAllComponentParams takes

snippet: the jsonnet snippet containing the component params.

and returns a map of key-value param pairs for each component identified.

func GetAllEnvironmentParams

func GetAllEnvironmentParams(snippet string) (map[string]Params, error)

GetAllEnvironmentParams takes

snippet: the jsonnet snippet containing the environment params. This is
         expected to be non-expanded schema; i.e. does not include the
         component params

and returns a map of key-value param pairs for each component identified.

func SetComponentParams

func SetComponentParams(component, snippet string, params Params) (string, error)

SetComponentParams takes

component: the name of the new component to be modified.
snippet: a jsonnet snippet resembling the current component parameters.
params: the parameters to be set for 'component'.

and returns the jsonnet snippet with the modified set of component parameters.

func SetEnvironmentParams

func SetEnvironmentParams(component, snippet string, params Params) (string, error)

SetEnvironmentParams takes

component: the name of the new component to be modified.
snippet: a jsonnet snippet resembling the current environment parameters (not expanded).
params: the parameters to be set for 'component'.

and returns the jsonnet snippet with the modified set of environment parameters.

Types

type Params

type Params map[string]interface{}

Params are ksonnet params.

func FromPath added in v0.10.0

func FromPath(key string, value interface{}, currentPath ...string) (Params, error)

FromPath converts a key and a value to a Param. The key can contain dots.

func GetComponentParams

func GetComponentParams(component, snippet string) (Params, error)

GetComponentParams takes

component: the name of the component to retrieve params for.
snippet: the jsonnet snippet containing the component parameters.

and returns a map of key-value param pairs corresponding to that component.

An error will be returned if the component is not found in the snippet.

func (Params) StringValue added in v0.10.0

func (p Params) StringValue(key string) (string, error)

StringValue retrieves the string value for a param.

Jump to

Keyboard shortcuts

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