source

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package source defines the base types and structures of all configuration source functionalities.

Index

Constants

View Source
const (
	// ID is the base application container registration string
	// for all configuration source services.
	ID = config.ID + ".source"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseSource

type BaseSource struct {
	Mutex  sync.Locker
	Config config.Config
}

BaseSource defines a config source that read a file content and stores its config contents to be used as a config.

func (*BaseSource) Get

func (s *BaseSource) Get(
	path string,
	def ...interface{},
) (interface{}, error)

Get will retrieve the value stored in the requested path present in the configuration content. If the path does not exist, then the value nil will be returned. This method will mostly be used by the config object to obtain the full content of the source to aggregate all the data into his internal storing config instance.

func (*BaseSource) Has

func (s *BaseSource) Has(
	path string,
) bool

Has will check if the requested path is present in the source configuration content.

Directories

Path Synopsis
Package aggregate defines the aggregate source creation strategy to be integrated into the config package source factory instance.
Package aggregate defines the aggregate source creation strategy to be integrated into the config package source factory instance.
Package dir defines the directory source creation strategy to be integrated into the config package source factory instance.
Package dir defines the directory source creation strategy to be integrated into the config package source factory instance.
Package env defines the environment source creation strategy to be integrated into the config package source factory instance.
Package env defines the environment source creation strategy to be integrated into the config package source factory instance.
Package file defines the file type sources creation strategies to be integrated into the config package source factory instance.
Package file defines the file type sources creation strategies to be integrated into the config package source factory instance.
Package rest defines the REST connection source creation strategy to be integrated into the config package source factory instance.
Package rest defines the REST connection source creation strategy to be integrated into the config package source factory instance.

Jump to

Keyboard shortcuts

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