property

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RegisteredResolvers = make(map[string]Resolver)
	EnabledResolvers    []Resolver
)

Functions

func EnablePropertyResolvers

func EnablePropertyResolvers(resolverTypes string) error

func PropertyResolverProcessor

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

func RegisterPropertyResolver

func RegisterPropertyResolver(resolver Resolver) error

func ResolveProperty

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

func SetDefaultManager

func SetDefaultManager(manager *Manager)

Types

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) GetProperty

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

type PostProcessor

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

type Resolver

type Resolver interface {
	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 GetPropertyResolver

func GetPropertyResolver(resolverType string) Resolver

Jump to

Keyboard shortcuts

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