Documentation
¶
Overview ¶
Package instance provides instances management.
Note that this package is not used for cache, as it has no cache expiration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOrSet ¶
GetOrSet returns the instance by name, or set instance to the instance manager if it does not exist and returns this instance.
func GetOrSetFunc ¶
GetOrSetFunc returns the instance by name, or sets instance with returned value of callback function `f` if it does not exist and then returns this instance.
func GetOrSetFuncLock ¶
GetOrSetFuncLock returns the instance by name, or sets instance with returned value of callback function `f` if it does not exist and then returns this instance.
GetOrSetFuncLock differs with GetOrSetFunc function is that it executes function `f` with mutex.Lock of the hash map.
func SetIfNotExist ¶
SetIfNotExist sets `instance` to the map if the `name` does not exist, then returns true. It returns false if `name` exists, and `instance` would be ignored.
Types ¶
This section is empty.