env

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const JAVA_OPTIONS = "JAVA_OPTS_APPEND"

Variables

This section is empty.

Functions

func ParseJavaOptionsMap added in v1.1.0

func ParseJavaOptionsMap(envCache EnvCache) map[string]string

func SaveJavaOptionsMap added in v1.1.0

func SaveJavaOptionsMap(envCache EnvCache, options map[string]string, lock bool)

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

	IsLocked() bool
}

type EnvCacheEntryBuilder added in v1.1.0

type EnvCacheEntryBuilder interface {
	SetDependency(name string) EnvCacheEntryBuilder

	SetPriority(priority Priority) EnvCacheEntryBuilder

	Lock() 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