inmemory

package
Version: v0.0.0-...-0feb2aa Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 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(ctx context.Context, cfg map[string]interface{}) error

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

Source Files

Jump to

Keyboard shortcuts

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