ctx

package
v0.0.0-...-4156d8f Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationContext

type ApplicationContext interface {
	RegisterBean(o interface{}) error
	RegisterBeanByName(name string, o interface{}) error

	GetBean(name string) (interface{}, bool)
	GetBeanByType(o interface{}) bool

	AddProcessor(processor.Processor)

	AddListener(ApplicationContextListener)
	NotifyListeners(ApplicationEvent)

	Close() error
}

type ApplicationContextListener

type ApplicationContextListener interface {
	OnRefresh(ctx ApplicationContext)
	OnEvent(e ApplicationEvent, ctx ApplicationContext)
}

type ApplicationEvent

type ApplicationEvent int
const (
	ApplicationEventNone ApplicationEvent = iota
	ApplicationEventInitialized
)

type DefaultApplicationContext

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

func NewDefaultApplicationContext

func NewDefaultApplicationContext(opts ...Opt) *DefaultApplicationContext

func (*DefaultApplicationContext) AddListener

func (*DefaultApplicationContext) AddProcessor

func (ctx *DefaultApplicationContext) AddProcessor(p processor.Processor)

func (*DefaultApplicationContext) Close

func (ctx *DefaultApplicationContext) Close() (err error)

func (*DefaultApplicationContext) GetBean

func (ctx *DefaultApplicationContext) GetBean(name string) (interface{}, bool)

func (*DefaultApplicationContext) GetBeanByType

func (ctx *DefaultApplicationContext) GetBeanByType(o interface{}) bool

func (*DefaultApplicationContext) NotifyListeners

func (ctx *DefaultApplicationContext) NotifyListeners(e ApplicationEvent)

func (*DefaultApplicationContext) RegisterBean

func (ctx *DefaultApplicationContext) RegisterBean(o interface{}) error

func (*DefaultApplicationContext) RegisterBeanByName

func (ctx *DefaultApplicationContext) RegisterBeanByName(name string, o interface{}) error

type Opt

type Opt func(*DefaultApplicationContext)

func OptSetContainer

func OptSetContainer(container container.Container) Opt

func OptSetInjector

func OptSetInjector(injector injector.Injector) Opt

func OptSetLogger

func OptSetLogger(logger xlog.Logger) Opt

Jump to

Keyboard shortcuts

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