property

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapPropertySource

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

func NewMapPropertySource

func NewMapPropertySource(name string, source map[string]interface{}) *MapPropertySource

func (*MapPropertySource) ContainsProperty

func (m *MapPropertySource) ContainsProperty(name string) bool

func (*MapPropertySource) Name

func (m *MapPropertySource) Name() string

func (*MapPropertySource) Property

func (m *MapPropertySource) Property(name string) (any, bool)

func (*MapPropertySource) PropertyNames

func (m *MapPropertySource) PropertyNames() []string

func (*MapPropertySource) PropertyOrDefault

func (m *MapPropertySource) PropertyOrDefault(name string, defaultValue any) any

func (*MapPropertySource) Source

func (m *MapPropertySource) Source() any

type Properties

type Properties interface {
	// contains filtered or unexported methods
}

type Resolver

type Resolver interface {
	ContainsProperty(name string) bool
	Property(name string) (string, bool)
	PropertyOrDefault(name string, defaultValue string) string
	ResolvePlaceholders(text string) string
	ResolveRequiredPlaceholders(text string) (string, error)
}

type Source

type Source interface {
	Name() string
	Source() any
	ContainsProperty(name string) bool
	Property(name string) (any, bool)
	PropertyOrDefault(name string, defaultValue any) any
	PropertyNames() []string
}

type SourceLoader

type SourceLoader interface {
	FileExtensions() []string
	LoadSource(name string, reader io.Reader) (Source, error)
}

type Sources

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

func NewPropertySources

func NewPropertySources() *Sources

func (*Sources) AddAtIndex

func (s *Sources) AddAtIndex(index int, source Source)

func (*Sources) AddFirst

func (s *Sources) AddFirst(source Source)

func (*Sources) AddLast

func (s *Sources) AddLast(source Source)

func (*Sources) Contains

func (s *Sources) Contains(name string) bool

func (*Sources) Find

func (s *Sources) Find(name string) (Source, bool)

func (*Sources) PrecendenceOf

func (s *Sources) PrecendenceOf(source Source) int

func (*Sources) Remove

func (s *Sources) Remove(name string) Source

func (*Sources) Replace

func (s *Sources) Replace(name string, source Source)

func (*Sources) Size

func (s *Sources) Size() int

func (*Sources) ToSlice

func (s *Sources) ToSlice() []Source

type SourcesResolver

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

func NewSourcesResolver

func NewSourcesResolver(sources *Sources) *SourcesResolver

func (*SourcesResolver) ContainsProperty

func (r *SourcesResolver) ContainsProperty(name string) bool

func (*SourcesResolver) Property

func (r *SourcesResolver) Property(name string) (string, bool)

func (*SourcesResolver) PropertyOrDefault

func (r *SourcesResolver) PropertyOrDefault(name string, defaultValue string) string

func (*SourcesResolver) ResolvePlaceholders

func (r *SourcesResolver) ResolvePlaceholders(s string) string

func (*SourcesResolver) ResolveRequiredPlaceholders

func (r *SourcesResolver) ResolveRequiredPlaceholders(s string) (string, error)

type YamlPropertySourceLoader

type YamlPropertySourceLoader struct {
}

func NewYamlPropertySourceLoader

func NewYamlPropertySourceLoader() *YamlPropertySourceLoader

func (*YamlPropertySourceLoader) FileExtensions

func (l *YamlPropertySourceLoader) FileExtensions() []string

func (*YamlPropertySourceLoader) LoadSource

func (l *YamlPropertySourceLoader) LoadSource(name string, reader io.Reader) (Source, error)

Jump to

Keyboard shortcuts

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