inmemory

package
v0.0.0-...-6a38ed3 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInMemoryManager

func NewInMemoryManager() *config.CfgManager

NewInMemoryManager create a manager for unit testing, doesn't involve database or REST

Types

type Driver

type Driver struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Driver driver for unit testing

func (*Driver) Load

func (d *Driver) Load(context.Context) (map[string]interface{}, error)

Load load data from driver, for example load from database, it should be invoked before get any user scope config for system scope config, because it is immutable, no need to call this method

func (*Driver) Save

func (d *Driver) Save(_ context.Context, cfg map[string]interface{}) error

Save only save user config setting to driver, for example: database, REST

Jump to

Keyboard shortcuts

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