datascope

package
v0.0.0-...-a532a67 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: LGPL-3.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(data map[interface{}]interface{}) app.DataScope

New create new instance of data scope

func NewChild

func NewChild(parent app.DataScope, data map[interface{}]interface{}) app.DataScope

NewChild create new instance of child data scope

func NewInjector

func NewInjector(tagname string, ds app.DataScope) app.Injector

NewInjector create new map injector instance

Types

type DataChildScope

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

DataChildScope represent child data scope. It contains all parent data and its own.

func (*DataChildScope) Keys

func (scp *DataChildScope) Keys() (keys []interface{})

Keys get map data

func (*DataChildScope) LockData

func (scp *DataChildScope) LockData() (locker app.DataScopeLocker)

LockData return new data locker

func (*DataChildScope) SetValue

func (scp *DataChildScope) SetValue(key interface{}, v interface{})

Set new scope value

func (*DataChildScope) Value

func (scp *DataChildScope) Value(key interface{}) (value interface{})

Get get value from context

type DataLocker

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

DataLocker represent the data scope transaction

func (*DataLocker) Commit

func (locker *DataLocker) Commit() (err error)

Commit unlock parent scope and close locker

func (*DataLocker) Keys

func (locker *DataLocker) Keys() (keys []interface{})

Keys get map data

func (*DataLocker) LockData

func (locker *DataLocker) LockData() app.DataScopeLocker

LockData return new data locker

func (*DataLocker) SetValue

func (locker *DataLocker) SetValue(key interface{}, v interface{})

func (*DataLocker) Value

func (locker *DataLocker) Value(key interface{}) (value interface{})

type DataScope

type DataScope struct {
	Data map[interface{}]interface{}
	// contains filtered or unexported fields
}

DataScope represent scope data

func (*DataScope) Keys

func (ds *DataScope) Keys() (keys []interface{})

Keys get map data

func (*DataScope) LockData

func (ds *DataScope) LockData() (locker app.DataScopeLocker)

LockData return new data locker

func (*DataScope) SetValue

func (ds *DataScope) SetValue(key interface{}, v interface{})

Set new scope value

func (*DataScope) Value

func (ds *DataScope) Value(key interface{}) (value interface{})

Get get value from context

type Injector

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

Injector is map data injector

func (Injector) InjectTo

func (ds Injector) InjectTo(obj interface{}) (err error)

InjectTo inject data from all injectors

Jump to

Keyboard shortcuts

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