memory

package
v0.0.0-...-678bb0e Latest Latest
Warning

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

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

Documentation

Overview

Package memory implements in-memory backend for the config client.

May be useful during local development or from unit tests. Do not use in production. It is terribly slow.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg map[string]ConfigSet) config.Interface

New makes an implementation of the config service which takes all configs from provided mapping {config set name -> map of configs}. For unit testing.

func SetError

func SetError(impl config.Interface, err error)

SetError artificially pins the error code returned by impl to err. If err is nil, impl will behave normally.

impl must be a memory config isntance created with New, else SetError will panic.

Types

type ConfigSet

type ConfigSet map[string]string

ConfigSet is a mapping from a file path to a config file body.

Jump to

Keyboard shortcuts

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