keyobservable

package
v1.5.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrKeyNotFound ErrKeyNotFound error
	ErrKeyNotFound = errors.New("Key not found")
)

Functions

This section is empty.

Types

type KeyObservableFunc

type KeyObservableFunc func(value interface{})

type Observable

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

KeyObservable struct

func KeyObservable

func KeyObservable() *Observable

func (*Observable) Get

func (ko *Observable) Get(key string) (interface{}, error)

Get Get key in persist array . return error if key is not found

func (*Observable) Put

func (ko *Observable) Put(key string, value interface{})

func (*Observable) RegisterFunc

func (ko *Observable) RegisterFunc(key string, f KeyObservableFunc)

func (*Observable) Set

func (ko *Observable) Set(key string, value interface{}, persist bool)

func (*Observable) UnRegisterFunc

func (ko *Observable) UnRegisterFunc(key string, f KeyObservableFunc)

Jump to

Keyboard shortcuts

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