dependencyinjection

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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 IServiceProvider interface {
	GetService(refObject interface{}) error
	GetServiceByName(refObject interface{}, name string) error
	GetGraph() string
}

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

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
)

Jump to

Keyboard shortcuts

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