autowire

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 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 NormalApp

type NormalApp struct {
	// inject main.ServiceImpl1 pointer to Service interface with proxy wrapper
	ServiceImpl1 Service `normal:"github.com/alibaba/ioc-golang/test/stress/autowire.ServiceImpl1"`

	// inject main.ServiceImpl2 pointer to Service interface with proxy wrapper
	ServiceImpl2 Service `normal:"github.com/alibaba/ioc-golang/test/stress/autowire.ServiceImpl2"`

	// inject ServiceImpl1 pointer to Service1 's own interface with proxy wrapper
	// this interface belongs to ServiceImpl1, there is no need to mark 'main.ServiceImpl1' in tag
	Service1OwnInterface ServiceImpl1IOCInterface `normal:""`

	// inject ServiceStruct struct pointer
	ServiceStruct *ServiceStruct `normal:""`
}

func GetNormalApp

func GetNormalApp() (*NormalApp, error)

func (*NormalApp) RunTest

func (s *NormalApp) RunTest(t *testing.T)

type NormalAppIOCInterface

type NormalAppIOCInterface interface {
	RunTest(t *testingx.T)
}

func GetNormalAppIOCInterface

func GetNormalAppIOCInterface() (NormalAppIOCInterface, error)

type Service

type Service interface {
	GetHelloString(string) string
}

type ServiceImpl1

type ServiceImpl1 struct {
}

func GetServiceImpl1

func GetServiceImpl1() (*ServiceImpl1, error)

func GetServiceImpl1Singleton

func GetServiceImpl1Singleton() (*ServiceImpl1, error)

func (*ServiceImpl1) GetHelloString

func (s *ServiceImpl1) GetHelloString(name string) string

type ServiceImpl1IOCInterface

type ServiceImpl1IOCInterface interface {
	GetHelloString(name string) string
}

func GetServiceImpl1IOCInterface

func GetServiceImpl1IOCInterface() (ServiceImpl1IOCInterface, error)

func GetServiceImpl1IOCInterfaceSingleton

func GetServiceImpl1IOCInterfaceSingleton() (ServiceImpl1IOCInterface, error)

type ServiceImpl2

type ServiceImpl2 struct {
}

func GetServiceImpl2

func GetServiceImpl2() (*ServiceImpl2, error)

func GetServiceImpl2Singleton

func GetServiceImpl2Singleton() (*ServiceImpl2, error)

func (*ServiceImpl2) GetHelloString

func (s *ServiceImpl2) GetHelloString(name string) string

type ServiceImpl2IOCInterface

type ServiceImpl2IOCInterface interface {
	GetHelloString(name string) string
}

func GetServiceImpl2IOCInterface

func GetServiceImpl2IOCInterface() (ServiceImpl2IOCInterface, error)

func GetServiceImpl2IOCInterfaceSingleton

func GetServiceImpl2IOCInterfaceSingleton() (ServiceImpl2IOCInterface, error)

type ServiceStruct

type ServiceStruct struct {
}

func GetServiceStruct

func GetServiceStruct() (*ServiceStruct, error)

func GetServiceStructSingleton

func GetServiceStructSingleton() (*ServiceStruct, error)

func (*ServiceStruct) GetString

func (s *ServiceStruct) GetString(name string) string

type ServiceStructIOCInterface

type ServiceStructIOCInterface interface {
	GetString(name string) string
}

func GetServiceStructIOCInterface

func GetServiceStructIOCInterface() (ServiceStructIOCInterface, error)

func GetServiceStructIOCInterfaceSingleton

func GetServiceStructIOCInterfaceSingleton() (ServiceStructIOCInterface, error)

type SingletonApp

type SingletonApp struct {
	// inject main.ServiceImpl1 pointer to Service interface with proxy wrapper
	ServiceImpl1 Service `singleton:"github.com/alibaba/ioc-golang/test/stress/autowire.ServiceImpl1"`

	// inject main.ServiceImpl2 pointer to Service interface with proxy wrapper
	ServiceImpl2 Service `singleton:"github.com/alibaba/ioc-golang/test/stress/autowire.ServiceImpl2"`

	// inject ServiceImpl1 pointer to Service1 's own interface with proxy wrapper
	// this interface belongs to ServiceImpl1, there is no need to mark 'main.ServiceImpl1' in tag
	Service1OwnInterface ServiceImpl1IOCInterface `singleton:""`

	// inject ServiceStruct struct pointer
	ServiceStruct *ServiceStruct `singleton:""`
}

func GetSingletonAppSingleton

func GetSingletonAppSingleton() (*SingletonApp, error)

func (*SingletonApp) RunTest

func (s *SingletonApp) RunTest(t *testing.T)

type SingletonAppIOCInterface

type SingletonAppIOCInterface interface {
	RunTest(t *testingx.T)
}

func GetSingletonAppIOCInterfaceSingleton

func GetSingletonAppIOCInterfaceSingleton() (SingletonAppIOCInterface, error)

type ThisServiceImpl1 added in v1.0.1

type ThisServiceImpl1 struct {
}

func (*ThisServiceImpl1) This added in v1.0.1

type ThisServiceImpl2 added in v1.0.1

type ThisServiceImpl2 struct {
}

func (*ThisServiceImpl2) This added in v1.0.1

type ThisServiceStruct added in v1.0.1

type ThisServiceStruct struct {
}

func (*ThisServiceStruct) This added in v1.0.1

type ThisSingletonApp added in v1.0.1

type ThisSingletonApp struct {
}

func (*ThisSingletonApp) This added in v1.0.1

Jump to

Keyboard shortcuts

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