container

package
v0.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get[T any](container *Container, name string) (T, error)

Types

type BeanInfo

type BeanInfo struct {
	Name         string
	Dependencies []string
	Params       map[string]any
	Constructor  Constructor
}

type Constructor

type Constructor func(depends map[string]any, params map[string]any) (interface{}, error)

type Container

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

func New

func New() *Container

func (*Container) Get

func (c *Container) Get(name string) (interface{}, error)

func (*Container) Register

func (c *Container) Register(beanInfo BeanInfo) error

Jump to

Keyboard shortcuts

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