Documentation
¶
Index ¶
- func AppendDotFlatMapKeyFormatter(path, newPart string) string
- func CapitalizeUnderscoreFlatMapKeyFormatter(path, newPart string) string
- func DeploymentStatus(yamlFile *DynamicYaml) (ready bool, err error)
- func GetBearerToken(in *restclient.Config, explicitKubeConfigPath string, ...) (token string, username string, err error)
- func GetClusterIp(url string)
- func GetDeployedWebURL(yamlFile *DynamicYaml) (string, error)
- func GetWildCardDNS(url string) string
- func IsIpv4(host string) bool
- func KubectlApply(filePath string) (stdout string, stderr string, err error)
- func KubectlDelete(filePath string) (err error)
- func KubectlGet(resource string, resourceName string, namespace string, extraArgs []string, ...) (stdout string, stderr string, err error)
- func LowerCamelCaseFlatMapKeyFormatter(path, newPart string) string
- func LowerCamelCaseStringFormat(value, separator string) string
- func NodeValueToActual(node *yaml.Node) (interface{}, error)
- func RandASCIIBytes(n int) ([]byte, error)
- func RandASCIIString(n int) (string, error)
- func RefreshAuthToken(in *restclient.Config) error
- func RefreshTokenIfExpired(restConfig *restclient.Config, explicitPath, curentToken string) (string, error)
- func ReloadKubeConfig(explicitPath string) clientcmd.ClientConfig
- type Config
- type DynamicYaml
- func (d *DynamicYaml) Delete(key string) error
- func (d *DynamicYaml) DeleteByParts(parts ...string) error
- func (d *DynamicYaml) DeleteByString(key, separator string) error
- func (d *DynamicYaml) FindMissingKeys(keys ...string) []string
- func (d *DynamicYaml) Flatten(keyFormatter FlatMapKeyFormatter) map[string]NodePair
- func (d *DynamicYaml) FlattenRequiredDefault()
- func (d *DynamicYaml) FlattenToKeyValue(keyFormatter FlatMapKeyFormatter) map[string]interface{}
- func (d *DynamicYaml) Get(key string) (keyNode, value *yaml.Node)
- func (d *DynamicYaml) GetByParts(parts ...string) (key, value *yaml.Node)
- func (d *DynamicYaml) GetValue(key string) (value *yaml.Node)
- func (d *DynamicYaml) GetValueByParts(parts ...string) (value *yaml.Node)
- func (d *DynamicYaml) GetValueWithSeparator(key, separator string) (value *yaml.Node)
- func (d *DynamicYaml) GetWithSeparator(key, separator string) (keyNode, value *yaml.Node)
- func (d *DynamicYaml) HasKey(key string) bool
- func (d *DynamicYaml) HasKeys(keys ...string) bool
- func (d *DynamicYaml) HideHidden() error
- func (d *DynamicYaml) Merge(items ...*DynamicYaml)
- func (d *DynamicYaml) Put(key string, value interface{}) *yaml.Node
- func (d *DynamicYaml) PutByParts(parts []string, value interface{}) *yaml.Node
- func (d *DynamicYaml) PutByPartsNode(parts []string, value *yaml.Node) (*yaml.Node, error)
- func (d *DynamicYaml) PutNode(key string, value *yaml.Node) (*yaml.Node, error)
- func (d *DynamicYaml) PutWithSeparator(key string, value interface{}, separator string) *yaml.Node
- func (d *DynamicYaml) PutWithSeparatorNode(key string, value *yaml.Node, separator string) (*yaml.Node, error)
- func (d *DynamicYaml) SetTopComment(comment string) error
- func (d *DynamicYaml) Sort()
- func (d *DynamicYaml) String() (string, error)
- type FlatMapKeyFormatter
- type NodePair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendDotFlatMapKeyFormatter ¶
e.g. path = "", newPart = "root". Return: "root"
path = "root", newPart = "child". Return: "root.child"
func DeploymentStatus ¶
func DeploymentStatus(yamlFile *DynamicYaml) (ready bool, err error)
func GetBearerToken ¶
func GetClusterIp ¶
func GetClusterIp(url string)
func GetDeployedWebURL ¶
func GetDeployedWebURL(yamlFile *DynamicYaml) (string, error)
func GetWildCardDNS ¶
func KubectlDelete ¶ added in v0.17.0
KubectlDelete run's kubectl delete using the input filePath
func KubectlGet ¶
func LowerCamelCaseStringFormat ¶ added in v0.12.0
LowerCamelCaseStringFormat takes a string, splits it by the separator and joins the pieces using LowerCamelCaseFlatMapKeyFormatter
func NodeValueToActual ¶
func NodeValueToActual(node *yaml.Node) (interface{}, error)
func RandASCIIBytes ¶ added in v0.18.0
RandASCIIBytes generates n rando ASCII bytes adapted from source: https://github.com/kpbird/golang_random_string/blob/master/main.go
func RandASCIIString ¶ added in v0.18.0
RandASCIIString returns a rnadom string up to n characters
func RefreshAuthToken ¶
func RefreshAuthToken(in *restclient.Config) error
func RefreshTokenIfExpired ¶
func RefreshTokenIfExpired(restConfig *restclient.Config, explicitPath, curentToken string) (string, error)
func ReloadKubeConfig ¶
func ReloadKubeConfig(explicitPath string) clientcmd.ClientConfig
Types ¶
type DynamicYaml ¶
type DynamicYaml struct {
// contains filtered or unexported fields
}
func LoadDynamicYamlFromFile ¶
func LoadDynamicYamlFromFile(filePath string) (*DynamicYaml, error)
func LoadDynamicYamlFromString ¶
func LoadDynamicYamlFromString(input string) (*DynamicYaml, error)
func (*DynamicYaml) Delete ¶
func (d *DynamicYaml) Delete(key string) error
func (*DynamicYaml) DeleteByParts ¶
func (d *DynamicYaml) DeleteByParts(parts ...string) error
func (*DynamicYaml) DeleteByString ¶
func (d *DynamicYaml) DeleteByString(key, separator string) error
func (*DynamicYaml) FindMissingKeys ¶ added in v0.17.0
func (d *DynamicYaml) FindMissingKeys(keys ...string) []string
FindMissingKeys will return an array of the keys that are not in the manifest
func (*DynamicYaml) Flatten ¶
func (d *DynamicYaml) Flatten(keyFormatter FlatMapKeyFormatter) map[string]NodePair
func (*DynamicYaml) FlattenRequiredDefault ¶
func (d *DynamicYaml) FlattenRequiredDefault()
FlattenRequiredDefault goes through the data and finds values with a default it then assigns the default value to the key in the data so when it is serialized it has that set. this also removes the subdata, so if you have s3.bucket.default, and s3.bucket.test, only s3.bucket will be present after.
func (*DynamicYaml) FlattenToKeyValue ¶
func (d *DynamicYaml) FlattenToKeyValue(keyFormatter FlatMapKeyFormatter) map[string]interface{}
func (*DynamicYaml) Get ¶
func (d *DynamicYaml) Get(key string) (keyNode, value *yaml.Node)
func (*DynamicYaml) GetByParts ¶
func (d *DynamicYaml) GetByParts(parts ...string) (key, value *yaml.Node)
func (*DynamicYaml) GetValue ¶
func (d *DynamicYaml) GetValue(key string) (value *yaml.Node)
func (*DynamicYaml) GetValueByParts ¶
func (d *DynamicYaml) GetValueByParts(parts ...string) (value *yaml.Node)
func (*DynamicYaml) GetValueWithSeparator ¶
func (d *DynamicYaml) GetValueWithSeparator(key, separator string) (value *yaml.Node)
func (*DynamicYaml) GetWithSeparator ¶
func (d *DynamicYaml) GetWithSeparator(key, separator string) (keyNode, value *yaml.Node)
func (*DynamicYaml) HasKey ¶
func (d *DynamicYaml) HasKey(key string) bool
func (*DynamicYaml) HasKeys ¶
func (d *DynamicYaml) HasKeys(keys ...string) bool
func (*DynamicYaml) HideHidden ¶ added in v0.12.0
func (d *DynamicYaml) HideHidden() error
HideHidden goes through the vars in the yaml and removes any where hide is set to true
func (*DynamicYaml) Merge ¶
func (d *DynamicYaml) Merge(items ...*DynamicYaml)
Merge will merge two DynamicYaml's together. If keys already exist, the source is kept.
func (*DynamicYaml) Put ¶
func (d *DynamicYaml) Put(key string, value interface{}) *yaml.Node
func (*DynamicYaml) PutByParts ¶
func (d *DynamicYaml) PutByParts(parts []string, value interface{}) *yaml.Node
func (*DynamicYaml) PutByPartsNode ¶
func (d *DynamicYaml) PutByPartsNode(parts []string, value *yaml.Node) (*yaml.Node, error)
func (*DynamicYaml) PutNode ¶
func (d *DynamicYaml) PutNode(key string, value *yaml.Node) (*yaml.Node, error)
func (*DynamicYaml) PutWithSeparator ¶
func (d *DynamicYaml) PutWithSeparator(key string, value interface{}, separator string) *yaml.Node
func (*DynamicYaml) PutWithSeparatorNode ¶
func (d *DynamicYaml) PutWithSeparatorNode(key string, value *yaml.Node, separator string) (*yaml.Node, error)
func (*DynamicYaml) SetTopComment ¶ added in v0.15.0
func (d *DynamicYaml) SetTopComment(comment string) error
SetTopComment sets the topmost comment in the resulting yaml
func (*DynamicYaml) Sort ¶
func (d *DynamicYaml) Sort()
func (*DynamicYaml) String ¶
func (d *DynamicYaml) String() (string, error)
type FlatMapKeyFormatter ¶
Path might be an empty string, denoting the start of a path. In that case, it is expected that newPart in some formatted form will be return. e.g. path = "", newPart = "root". Return: "root"
path = "root", newPart = "child". Return: "root.child"