Documentation
¶
Index ¶
- type Container
- func (c *Container) All() []any
- func (c *Container) Count() int
- func (c *Container) Get(name string) any
- func (c *Container) GetOrSetFunc(name string, fn func() any) any
- func (c *Container) Pop(name string) any
- func (c *Container) Remove(name string)
- func (c *Container) Set(name string, instance any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container is a singleton container.
func (*Container) GetOrSetFunc ¶
GetOrSetFunc gets the instance, if it does not exist, it will be created by the function.
Click to show internal directories.
Click to hide internal directories.