property

package
v0.0.11 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapSource

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

func NewMapSource

func NewMapSource(name string, source map[string]interface{}) *MapSource

func (*MapSource) ContainsProperty

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

func (*MapSource) Name

func (m *MapSource) Name() string

func (*MapSource) Property

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

func (*MapSource) PropertyNames

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

func (*MapSource) PropertyOrDefault

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

func (*MapSource) Source

func (m *MapSource) Source() any

type Properties

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

type Resolver

type Resolver interface {
	ContainsProperty(name string) bool
	Property(name string) (any, bool)
	PropertyOrDefault(name string, defaultValue any) any
	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
	Load(name string, reader io.Reader) (Source, error)
}

type Sources

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

func NewSources

func NewSources() *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) Count

func (s *Sources) Count() int

func (*Sources) Find

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

func (*Sources) PrecedenceOf

func (s *Sources) PrecedenceOf(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) ToSlice

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

type SourcesResolver

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

func NewSourcesResolver

func NewSourcesResolver(sources ...Source) *SourcesResolver

func (*SourcesResolver) ContainsProperty

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

func (*SourcesResolver) Property

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

func (*SourcesResolver) PropertyOrDefault

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

func (*SourcesResolver) ResolvePlaceholders

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

func (*SourcesResolver) ResolveRequiredPlaceholders

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

type YamlSourceLoader

type YamlSourceLoader struct {
}

func (*YamlSourceLoader) FileExtensions

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

func (*YamlSourceLoader) Load

func (l *YamlSourceLoader) Load(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