factory

package
Version: v0.0.0-...-885c2a5 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2015 License: LGPL-2.1 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FactoryAutoInitFuncName = "init_auto"
)
View Source
const InjectTagName string = "inject"

Variables

This section is empty.

Functions

func NewContainer

func NewContainer() goweb.FactoryContainer

Types

type FactoryStandalone

type FactoryStandalone struct {
}

FactoryStandalone is the factory that only one instance in system,all the Enjection share on the same factory instance. so be carful for thread-safe

独立状态工厂接口,仅有一个实例存在与系统中,所有注入共享一个实例,所以必要时应该考虑线程 安全。

func (FactoryStandalone) Type

func (f FactoryStandalone) Type() goweb.LifeType

type FactoryStateful

type FactoryStateful struct {
}

FactoryStateful is stateful for user in session. each session has the one and only instance for itself, no shared, and will auto destroy when session timeout or be destroyed.

有状态工厂接口,面向用户的有状态工厂,每个会话(SESSION)包含一个与众不同的实例,不共 享,当会话(SESSION)超时或摧毁时包含的有状态的工厂也将被自动摧毁

func (FactoryStateful) Type

func (f FactoryStateful) Type() goweb.LifeType

type FactoryStateless

type FactoryStateless struct {
}

FactoryStateless is stateless for user in session. Enjection will allways create a new factory instance for using.

无状态工厂接口,面向用户无状态,每次注入(Enject)将创建一个新的实例以供调用。

func (FactoryStateless) Type

func (f FactoryStateless) Type() goweb.LifeType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL