inline

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package inline provides a KV provider that serves secrets from a literal key/value map embedded in the configuration. It is a Standalone provider (no caching): lookups are an in-memory map read, with nothing to refresh.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyKey = errors.New("inline: key must not be empty")

ErrEmptyKey is returned by Get for an empty key.

Functions

func NewFactory

func NewFactory() kv.ProviderFactory

NewFactory returns a ProviderFactory for inline stores.

An empty or absent config is valid and yields a provider with no data: the store registers unconditionally and every Get is not-found until data is supplied. Invalid JSON returns an error.

Types

type Config

type Config struct {
	// Data holds the values themselves, as key/value pairs written straight into
	// this configuration: with {"db_password": "s3cret"}, the reference
	// kv://<store-name>/db_password resolves to "s3cret".
	//
	// Because the values sit in the configuration in plain text, wherever that
	// configuration is stored and whoever can read it, this store suits
	// development, testing and values that are not really secret. Anything that
	// genuinely needs protecting belongs in one of the other backends.
	//
	// Keys are matched exactly: nothing is added to them and case matters.
	// Leaving it empty is valid — every read is then reported as not found.
	Data map[string]string `json:"data"`
}

Config is used to configure an inline store.

Jump to

Keyboard shortcuts

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