Documentation
¶
Index ¶
- func GracefulShutdown(ctx context.Context, wg *sync.WaitGroup)
- func Inject[T any](name ...string) func() T
- type ApplicationContext
- type BeanDefinition
- type BeanDefinitionImpl
- func (b *BeanDefinitionImpl[T]) Factory(f func() *T) *BeanDefinitionImpl[T]
- func (b *BeanDefinitionImpl[T]) Name(names ...string) *BeanDefinitionImpl[T]
- func (b *BeanDefinitionImpl[T]) PostConstruct(f func(*T)) *BeanDefinitionImpl[T]
- func (b *BeanDefinitionImpl[T]) PreDestroy(f func(*T)) *BeanDefinitionImpl[T]
- func (b *BeanDefinitionImpl[T]) Primary() *BeanDefinitionImpl[T]
- func (b *BeanDefinitionImpl[T]) Profile(profileExpr ...string) *BeanDefinitionImpl[T]
- func (b *BeanDefinitionImpl[T]) Register()
- func (b *BeanDefinitionImpl[T]) Scope(scope string) *BeanDefinitionImpl[T]
- func (b *BeanDefinitionImpl[T]) String() string
- type InjectQualifier
- type Profile
- type Scope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApplicationContext ¶
type ApplicationContext struct {
// contains filtered or unexported fields
}
func ApplicationContextInstance ¶
func ApplicationContextInstance() *ApplicationContext
func (*ApplicationContext) Bean ¶
func (c *ApplicationContext) Bean(inject *InjectQualifier[any]) any
func (*ApplicationContext) Close ¶ added in v1.0.2
func (c *ApplicationContext) Close()
func (*ApplicationContext) Register ¶
func (c *ApplicationContext) Register(bean BeanDefinition)
type BeanDefinition ¶
type BeanDefinition interface { String() string // contains filtered or unexported methods }
type BeanDefinitionImpl ¶
type BeanDefinitionImpl[T any] struct { // contains filtered or unexported fields }
func (*BeanDefinitionImpl[T]) Factory ¶
func (b *BeanDefinitionImpl[T]) Factory(f func() *T) *BeanDefinitionImpl[T]
Set the factory method reference or anonymous function with actual implementation
func (*BeanDefinitionImpl[T]) Name ¶
func (b *BeanDefinitionImpl[T]) Name(names ...string) *BeanDefinitionImpl[T]
Set optional name(s)
func (*BeanDefinitionImpl[T]) PostConstruct ¶
func (b *BeanDefinitionImpl[T]) PostConstruct(f func(*T)) *BeanDefinitionImpl[T]
It is safe to use injected beans at this point
func (*BeanDefinitionImpl[T]) PreDestroy ¶
func (b *BeanDefinitionImpl[T]) PreDestroy(f func(*T)) *BeanDefinitionImpl[T]
Clean-up resources before shutdown. Not called on prototype beans.
func (*BeanDefinitionImpl[T]) Primary ¶
func (b *BeanDefinitionImpl[T]) Primary() *BeanDefinitionImpl[T]
Mark this bean as primary
func (*BeanDefinitionImpl[T]) Profile ¶ added in v1.0.1
func (b *BeanDefinitionImpl[T]) Profile(profileExpr ...string) *BeanDefinitionImpl[T]
Profile binding
func (*BeanDefinitionImpl[T]) Register ¶
func (b *BeanDefinitionImpl[T]) Register()
Register the bean within the context
func (*BeanDefinitionImpl[T]) Scope ¶
func (b *BeanDefinitionImpl[T]) Scope(scope string) *BeanDefinitionImpl[T]
Set optional scope
func (*BeanDefinitionImpl[T]) String ¶
func (b *BeanDefinitionImpl[T]) String() string
Implements String
type InjectQualifier ¶
type InjectQualifier[T any] struct { // contains filtered or unexported fields }
func (*InjectQualifier[T]) Name ¶
func (i *InjectQualifier[T]) Name(name string) *InjectQualifier[T]
Click to show internal directories.
Click to hide internal directories.