env

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const JAVA_OPTIONS = "JAVA_OPTS_APPEND"
View Source
const JAVA_OPTIONS_COMBINED = "__JAVA_OPTIONS_COMBINED__bedc397c-9486-4d87-8741-e4c90e72abe5__"
View Source
const JAVA_OPTIONS_LEGACY = "JAVA_OPTIONS"
View Source
const JAVA_OPTIONS_OPERATOR = "__JAVA_OPTIONS_OPERATOR__bedc397c-9486-4d87-8741-e4c90e72abe5__"

Variables

This section is empty.

Functions

func GetEnv added in v1.1.2

func GetEnv(haystack []core.EnvVar, name string) (*core.EnvVar, bool)

func MergeMaps added in v1.1.2

func MergeMaps(base map[string]string, update map[string]string)

func ParseCombinedJavaOptionsMap added in v1.1.2

func ParseCombinedJavaOptionsMap(envCache EnvCache) (map[string]string, error)

func ParseOperatorJavaOptionsMap added in v1.1.2

func ParseOperatorJavaOptionsMap(envCache EnvCache) (map[string]string, error)

func ParseShellArgs added in v1.1.2

func ParseShellArgs(input string) (map[string]string, error)

func RemoveEnv added in v1.1.2

func RemoveEnv(haystack []core.EnvVar, name string) ([]core.EnvVar, bool)

func SaveCombinedJavaOptionsMap added in v1.1.2

func SaveCombinedJavaOptionsMap(envCache EnvCache, javaOptions map[string]string)

func SaveOperatorJavaOptionsMap added in v1.1.2

func SaveOperatorJavaOptionsMap(envCache EnvCache, javaOptions map[string]string)

Types

type EnvCache

type EnvCache interface {
	// Returns the value and a boolean representing if the value exists
	Get(key string) (EnvCacheEntry, bool)

	Set(value EnvCacheEntry)

	// Get the entries based on the declared dependencies,
	// entry that has a dependency goes after it
	// panics if there is a dependency chain longer than 20 items
	GetSorted() []core.EnvVar

	// Try to delete and return true if the key existed
	Delete(value EnvCacheEntry) bool

	DeleteByName(key string) bool

	// Return true if the enty with the given key was marked fo deletion in the
	// given period
	WasDeleted(key string) bool

	// Delete the entries marked for deletion,
	// and mark the cache as not-changed again.
	// Do not call this outside of env CF!
	ProcessAndAdvanceToNextPeriod()

	IsChanged() bool
}

func NewEnvCache

func NewEnvCache(log *zap.Logger) EnvCache

The cache tries to preserve the order of addition. When sorting, it only reorders so far that it satisfies dependency relation

type EnvCacheEntry

type EnvCacheEntry interface {
	GetName() string

	GetValue() *core.EnvVar

	GetDependencies() []string

	GetPriority() Priority
}

type EnvCacheEntryBuilder added in v1.1.0

type EnvCacheEntryBuilder interface {
	SetDependency(name string) EnvCacheEntryBuilder

	SetPriority(priority Priority) EnvCacheEntryBuilder

	Build() EnvCacheEntry
}

func NewEnvCacheEntryBuilder added in v1.1.0

func NewEnvCacheEntryBuilder(value *core.EnvVar) EnvCacheEntryBuilder

Makes a deep copy of the inner value

func NewSimpleEnvCacheEntryBuilder added in v1.1.0

func NewSimpleEnvCacheEntryBuilder(name string, value string) EnvCacheEntryBuilder

type Priority added in v1.1.0

type Priority int
const (
	// TODO DEPRECATION:
	// - Remove support for variables from Deployment
	// - Make sure unused env. variables are deleted (see cf_kafkasql_security_scram)
	// - Operator-set variables are now lowest precedence
	PRIORITY_MIN        Priority = 0
	PRIORITY_DEPLOYMENT Priority = 1 // TODO Deprecated
	PRIORITY_SPEC       Priority = 2
	PRIORITY_OPERATOR   Priority = 3
	PRIORITY_MAX        Priority = 4
)

Jump to

Keyboard shortcuts

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