datasource

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSource

type DataSource interface {
	// Get returns the value of the given key.
	// key support dot notation.
	// Example:
	//  - Get("port", "port")
	//  - Get("redis.port", "port")
	//  - Get("address.city.houses.0.id", "id")
	Get(path string, key string) any
}

DataSource defines the interface for loading data from a data source.

func GetterToDataSource added in v1.3.2

func GetterToDataSource(s Getter) DataSource

func NewEnvSource added in v1.2.7

func NewEnvSource() DataSource

NewEnvSource creates a new envDataSource.

func NewMapDataSource

func NewMapDataSource(data map[string]any) DataSource

NewMapDataSource creates a new MapDataSource.

type Getter added in v1.3.2

type Getter interface {
	Get(string) any
}

Jump to

Keyboard shortcuts

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