package
5.3.0
Repository: https://github.com/micro/go-micro.git
Documentation: pkg.go.dev

# README

Memory Source

The memory source provides in-memory data as a source

Memory Format

The expected data format is json

data := []byte(`{
    "hosts": {
        "database": {
            "address": "10.0.0.1",
            "port": 3306
        },
        "cache": {
            "address": "10.0.0.2",
            "port": 6379
        }
    }
}`)

New Source

Specify source with data

memorySource := memory.NewSource(
	memory.WithJSON(data),
)

Load Source

Load the source into config

// Create new config
conf := config.NewConfig()

// Load memory source
conf.Load(memorySource)

# Functions

WithChangeSet allows a changeset to be set.
WithJSON allows the source data to be set to json.
WithYAML allows the source data to be set to yaml.