Documentation ¶
Index ¶
- type DefaultServiceProvider
- type IServiceProvider
- type IServiceProviderFactory
- type ServiceCollection
- func (sc *ServiceCollection) AddServiceDescriptor(sd *ServiceDescriptor)
- func (sc *ServiceCollection) AddSingleton(provider interface{})
- func (sc *ServiceCollection) AddSingletonAndName(name string, provider interface{})
- func (sc *ServiceCollection) AddSingletonByImplements(provider interface{}, implements interface{})
- func (sc *ServiceCollection) AddSingletonByImplementsAndName(name string, provider interface{}, implements interface{})
- func (sc *ServiceCollection) AddSingletonByName(name string, provider interface{})
- func (sc *ServiceCollection) AddSingletonByNameAndImplements(name string, provider interface{}, implements interface{})
- func (sc *ServiceCollection) AddTransient(provider interface{})
- func (sc *ServiceCollection) AddTransientByImplements(provider interface{}, implements interface{})
- func (sc *ServiceCollection) AddTransientByName(name string, provider interface{})
- func (sc ServiceCollection) Build() IServiceProvider
- type ServiceDescriptor
- func NewServiceDescriptor(name string, provider interface{}, implements interface{}, ...) *ServiceDescriptor
- func NewServiceDescriptorByImplements(provider interface{}, implements interface{}, lifetime ServiceLifetime) *ServiceDescriptor
- func NewServiceDescriptorByName(name string, provider interface{}, lifetime ServiceLifetime) *ServiceDescriptor
- func NewServiceDescriptorByProvider(provider interface{}, lifetime ServiceLifetime) *ServiceDescriptor
- type ServiceLifetime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultServiceProvider ¶
type DefaultServiceProvider struct {
// contains filtered or unexported fields
}
func (DefaultServiceProvider) GetGraph ¶
func (d DefaultServiceProvider) GetGraph() string
func (DefaultServiceProvider) GetService ¶
func (d DefaultServiceProvider) GetService(refObject interface{}) (err error)
func (DefaultServiceProvider) GetServiceByName ¶
func (d DefaultServiceProvider) GetServiceByName(refObject interface{}, name string) (err error)
type IServiceProvider ¶
type IServiceProviderFactory ¶
type IServiceProviderFactory interface {
CreateServiceProvider() IServiceProvider
}
type ServiceCollection ¶
type ServiceCollection struct {
// contains filtered or unexported fields
}
func NewServiceCollection ¶
func NewServiceCollection() *ServiceCollection
func (*ServiceCollection) AddServiceDescriptor ¶
func (sc *ServiceCollection) AddServiceDescriptor(sd *ServiceDescriptor)
Singleton Scoped Transient
func (*ServiceCollection) AddSingleton ¶
func (sc *ServiceCollection) AddSingleton(provider interface{})
func (*ServiceCollection) AddSingletonAndName ¶
func (sc *ServiceCollection) AddSingletonAndName(name string, provider interface{})
func (*ServiceCollection) AddSingletonByImplements ¶
func (sc *ServiceCollection) AddSingletonByImplements(provider interface{}, implements interface{})
func (*ServiceCollection) AddSingletonByImplementsAndName ¶
func (sc *ServiceCollection) AddSingletonByImplementsAndName(name string, provider interface{}, implements interface{})
func (*ServiceCollection) AddSingletonByName ¶
func (sc *ServiceCollection) AddSingletonByName(name string, provider interface{})
func (*ServiceCollection) AddSingletonByNameAndImplements ¶
func (sc *ServiceCollection) AddSingletonByNameAndImplements(name string, provider interface{}, implements interface{})
func (*ServiceCollection) AddTransient ¶
func (sc *ServiceCollection) AddTransient(provider interface{})
func (*ServiceCollection) AddTransientByImplements ¶
func (sc *ServiceCollection) AddTransientByImplements(provider interface{}, implements interface{})
func (*ServiceCollection) AddTransientByName ¶
func (sc *ServiceCollection) AddTransientByName(name string, provider interface{})
func (ServiceCollection) Build ¶
func (sc ServiceCollection) Build() IServiceProvider
type ServiceDescriptor ¶
type ServiceDescriptor struct { Name string Provider interface{} Implements interface{} Lifetime ServiceLifetime }
func NewServiceDescriptor ¶
func NewServiceDescriptor(name string, provider interface{}, implements interface{}, lifetime ServiceLifetime) *ServiceDescriptor
func NewServiceDescriptorByImplements ¶
func NewServiceDescriptorByImplements(provider interface{}, implements interface{}, lifetime ServiceLifetime) *ServiceDescriptor
func NewServiceDescriptorByName ¶
func NewServiceDescriptorByName(name string, provider interface{}, lifetime ServiceLifetime) *ServiceDescriptor
func NewServiceDescriptorByProvider ¶
func NewServiceDescriptorByProvider(provider interface{}, lifetime ServiceLifetime) *ServiceDescriptor
type ServiceLifetime ¶
type ServiceLifetime int32
const ( Singleton ServiceLifetime = 0 Scoped ServiceLifetime = 1 Transient ServiceLifetime = 2 )
Click to show internal directories.
Click to hide internal directories.