property

package
v1.6.26 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: BSD-3-Clause Imports: 11 Imported by: 15 modules, 13 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RegisteredResolvers = make(map[string]ExternalResolver)
	EnabledResolvers    []ExternalResolver
)
View Source
var EnvAppPropertyReconfigure = "FLOGO_APP_PROP_RECONFIGURE"
View Source
var EnvAppPropertySnapshotEnabled = "FLOGO_APP_PROP_SNAPSHOTS"

Functions

func EnableExternalPropertyResolvers added in v0.9.4

func EnableExternalPropertyResolvers(resolverTypes string) error

func ExternalResolverProcessor added in v0.9.4

func ExternalResolverProcessor(properties map[string]interface{}) error

func IsPropertyReconfigureEnabled added in v1.6.9

func IsPropertyReconfigureEnabled() bool

func IsPropertySnapshotEnabled added in v0.10.0

func IsPropertySnapshotEnabled() bool

func RegisterExternalResolver added in v0.9.4

func RegisterExternalResolver(resolver ExternalResolver) error

func RegisterPropertyResolver

func RegisterPropertyResolver(resolver ExternalResolver) error

DEPRECATED

func ResolvePropertyExternally added in v0.9.4

func ResolvePropertyExternally(propertyName string) (interface{}, bool)

func SetDefaultManager

func SetDefaultManager(manager *Manager)

Types

type ExternalResolver added in v0.9.4

type ExternalResolver interface {
	// Name of the resolver (e.g., consul)
	Name() string
	// Should return value and true if the given key exists in the external configuration otherwise should return nil and false.
	LookupValue(key string) (interface{}, bool)
}

Resolver used to resolve property value from external configuration like env, file etc

func GetExternalPropertyResolver added in v0.9.4

func GetExternalPropertyResolver(resolverType string) ExternalResolver

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager is safe for concurrent use. Each read sees one whole snapshot, which is never modified once published; values are not deep-copied, so callers must not modify a map or slice value.

func DefaultManager

func DefaultManager() *Manager

func NewManager

func NewManager(properties map[string]Property) *Manager

NewManager returns a Manager that holds a copy of properties: later changes to the map do not affect it.

func (*Manager) Finalize

func (m *Manager) Finalize(processors ...PostProcessor) error

Finalize runs the processors in order on a copy of the values, ignoring their errors and any key they add or remove, then publishes the result. Calls run one at a time.

func (*Manager) GetProperties added in v0.10.0

func (m *Manager) GetProperties() map[string]interface{}

GetProperties returns a copy of the current property values. The caller owns the map.

func (*Manager) GetProperty

func (m *Manager) GetProperty(name string) (interface{}, bool)

func (*Manager) IsOverridable added in v1.6.26

func (m *Manager) IsOverridable(name string) bool

type PostProcessor

type PostProcessor func(properties map[string]interface{}) error

PostProcessor may change the map it receives, a private copy, but not a map or slice value in it: the published snapshot shares those. It may read the Manager but must not call Finalize, which would deadlock.

type Property added in v1.6.26

type Property struct {
	Value       interface{}
	Overridable bool
}

type Resolver

type Resolver struct {
}

func (*Resolver) GetResolverInfo added in v0.9.4

func (*Resolver) GetResolverInfo() *resolve.ResolverInfo

func (*Resolver) Resolve added in v0.9.4

func (*Resolver) Resolve(scope data.Scope, item string, field string) (interface{}, error)

Resolver Property Resolver $property[item]

Jump to

Keyboard shortcuts

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