Discover Packages
github.com/zhiyunliu/golibs
group
package
Version:
v0.2.9
Opens a new window with list of versions in this module.
Published: Nov 18, 2024
License: Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package group provides a sample lazy load container.
The group only creating a new object not until the object is needed by user.
And it will cache all the objects to reduce the creation of object.
Group is a lazy load container.
func NewGroup(new func() interface{}) *Group
NewGroup news a group container.
Clear deletes all objects.
Get gets the object by the given key.
func (g *Group ) Reset(new func() interface{})
Reset resets the new function and deletes all existing objects.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.