inmemory

package
v0.0.0-...-beb5f3f Latest Latest
Warning

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

Go to latest
Published: May 6, 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