property

package
v0.2.18 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: BSD-3-Clause Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func EnableExternalPropertyResolvers

func EnableExternalPropertyResolvers(resolverTypes string) error

func ExternalResolverProcessor

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

func IsPropertySnapshotEnabled

func IsPropertySnapshotEnabled() bool

func RegisterExternalResolver

func RegisterExternalResolver(resolver ExternalResolver) error

func RegisterPropertyResolver

func RegisterPropertyResolver(resolver ExternalResolver) error

DEPRECATED

func ResolvePropertyExternally

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

func SetDefaultManager

func SetDefaultManager(manager *Manager)

Types

type ExternalResolver

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

func GetExternalPropertyResolver(resolverType string) ExternalResolver

type Manager

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

func DefaultManager

func DefaultManager() *Manager

func NewManager

func NewManager(properties map[string]interface{}) *Manager

func (*Manager) Finalize

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

func (*Manager) GetProperties added in v0.0.7

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

func (*Manager) GetProperty

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

type PostProcessor

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

type Resolver

type Resolver struct {
}

func (*Resolver) GetResolverInfo added in v0.0.4

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

func (*Resolver) Resolve added in v0.0.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