-
Notifications
You must be signed in to change notification settings - Fork 1
/
zz_generated.ioc.go
77 lines (65 loc) · 1.66 KB
/
zz_generated.ioc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
// Code generated by iocli, run 'iocli gen' to re-generate
package main
import (
autowire "github.com/alibaba/ioc-golang/autowire"
normal "github.com/alibaba/ioc-golang/autowire/normal"
singleton "github.com/alibaba/ioc-golang/autowire/singleton"
util "github.com/alibaba/ioc-golang/autowire/util"
)
func init() {
normal.RegisterStructDescriptor(&autowire.StructDescriptor{
Factory: func() interface{} {
return &starter_{}
},
})
starterStructDescriptor := &autowire.StructDescriptor{
Factory: func() interface{} {
return &Starter{}
},
Metadata: map[string]interface{}{
"aop": map[string]interface{}{},
"autowire": map[string]interface{}{},
},
}
singleton.RegisterStructDescriptor(starterStructDescriptor)
}
type starter_ struct {
Run_ func() error
}
func (s *starter_) Run() error {
return s.Run_()
}
type StarterIOCInterface interface {
Run() error
}
var _starterSDID string
func GetStarterSingleton() (*Starter, error) {
if _starterSDID == "" {
_starterSDID = util.GetSDIDByStructPtr(new(Starter))
}
i, err := singleton.GetImpl(_starterSDID, nil)
if err != nil {
return nil, err
}
impl := i.(*Starter)
return impl, nil
}
func GetStarterIOCInterfaceSingleton() (StarterIOCInterface, error) {
if _starterSDID == "" {
_starterSDID = util.GetSDIDByStructPtr(new(Starter))
}
i, err := singleton.GetImplWithProxy(_starterSDID, nil)
if err != nil {
return nil, err
}
impl := i.(StarterIOCInterface)
return impl, nil
}
type ThisStarter struct {
}
func (t *ThisStarter) This() StarterIOCInterface {
thisPtr, _ := GetStarterIOCInterfaceSingleton()
return thisPtr
}