-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.go
37 lines (29 loc) · 854 Bytes
/
types.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
package container
import "github.com/sirupsen/logrus"
type BuilderFunc func(app Container) interface{}
type ServiceProviderBuilder func(app Container) ServiceProvider
type Container interface {
SetDebug(debug bool)
GetLogger() *logrus.Entry
MakeWithContainer(container Container, abstract string) (instance interface{})
Singleton(abstract string, builder BuilderFunc)
Bind(abstract string, builder BuilderFunc)
Instance(abstract string, instance interface{})
Make(abstract string) (instance interface{})
Flush()
ForgetInstances()
ForgetInstance(abstract string)
Alias(name, abstract string)
}
type Kernel interface {
Container
Register(builder ServiceProviderBuilder)
}
type ServiceProvider interface {
SetContainer(container Container)
IsDefer() bool
IsBooted() bool
Boot()
Register(container Container)
Provides() []string
}