memory

package
v1.10.6 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config is an in memory config used for testing

func NewConfig

func NewConfig(value interface{}) *Config

NewConfig returns a new in memory config. Use an initial nil value to indicate no value is set

func (*Config) ClearValue

func (c *Config) ClearValue()

ClearValue sets up the config as if no value has been set, resulting in ErrNoValue being returned on subsequent Get Calls

func (*Config) Get

func (c *Config) Get(_ context.Context) (interface{}, error)

Get implements Config.Get

func (*Config) InduceErrors

func (c *Config) InduceErrors()

InduceErrors instructs the config to simulate an error getting a config value

func (*Config) SetValue

func (c *Config) SetValue(value interface{})

SetValue sets the value that should be returned on subsequent Get calls

func (*Config) Shutdown

func (c *Config) Shutdown()

Shutdown implements Config.Shutdown

func (*Config) StopInducingErrors

func (c *Config) StopInducingErrors()

StopInducingErrors stops the config from simulating an error getting a config value

Jump to

Keyboard shortcuts

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