common

package
v1.2.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrFmtNoAttribute is an error string for not-found attributes
	ErrFmtNoAttribute = `"attribute not found: %s`
	// ErrFmtUnexpectedType is an error string for attribute map values of unexpected type
	ErrFmtUnexpectedType = `unexpected type for attribute %s: Expecting a string`
	// ErrGetPasswordSecret is an error string for failing to get password secret
	ErrGetPasswordSecret = "cannot get password secret"
	// VersionV1Beta1 is used for resources that meet the v1beta1 criteria
	// here: https://github.com/upbound/arch/pull/33
	VersionV1Beta1 = "v1beta1"
)

Variables

This section is empty.

Functions

func AddCommonReferences

func AddCommonReferences(r *tjconfig.Resource) error

AddCommonReferences adds some common reference fields. This is a part of resource generation pipeline.

func GetField added in v0.35.0

func GetField(from map[string]interface{}, path string) (string, error)

GetField returns the value of field as a string in a map[string]interface{},

fails properly otherwise.

func PasswordGenerator added in v0.39.0

func PasswordGenerator(secretRefFieldPath, toggleFieldPath string) tjconfig.NewInitializerFn

PasswordGenerator returns an InitializerFn that will generate a password for a resource if the toggle field is set to true and the secret referenced by the secretRefFieldPath is not found or does not have content corresponding to the password key.

func RemoveIndex added in v0.41.0

func RemoveIndex(s []string, elementToRemove string) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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