-
Notifications
You must be signed in to change notification settings - Fork 229
/
freedom.go
99 lines (72 loc) · 2.57 KB
/
freedom.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package freedom
import (
"github.com/8treenet/freedom/internal"
"github.com/8treenet/iris/v12/hero"
"github.com/8treenet/iris/v12/mvc"
iris "github.com/8treenet/iris/v12"
"github.com/kataras/golog"
)
func init() {
initApp()
initConfigurator()
}
const (
//TransactionKey for transaction DB handles in the first-level cache
TransactionKey = internal.TransactionKey
)
type (
// IrisResult represents an type alias to hero.Result
IrisResult = hero.Result
// IrisContext represents an type alias to iris.Context
IrisContext = iris.Context
// IrisBeforeActivation represents an type alias to mvc.BeforeActivation
IrisBeforeActivation = mvc.BeforeActivation
// IrisConfiguration represents an type alias to iris.Configuration
IrisConfiguration = iris.Configuration
)
type (
// Worker Request a runtime object.
Worker = internal.Worker
// Initiator Initialize the binding relationship between the user's code and the associated code.
Initiator = internal.Initiator
// Repository The parent class of the repository, which can be inherited using the parent class's methods.
Repository = internal.Repository
// Infra The parent class of the infrastructure, which can be inherited using the parent class's methods.
Infra = internal.Infra
// Entity is the entity's father interface.
Entity = internal.Entity
// DomainEvent Interface definition of domain events for subscription and publishing of entities.
DomainEvent = internal.DomainEvent
//UnitTest is a unit test tool.
UnitTest = internal.UnitTest
// BootManager Can be used to launch in the application.
BootManager = internal.BootManager
// Bus Message bus, using http header to pass through data.
Bus = internal.Bus
// BusHandler is the bus message middleware type.
BusHandler = internal.BusHandler
// Result is the controller return type.
Result = IrisResult
// Context is the context type.
Context = IrisContext
// Configuration is the configuration type of the app.
Configuration = IrisConfiguration
// BeforeActivation is Is the start-up pre-processing of the action.
BeforeActivation = IrisBeforeActivation
// LogFields is the column type of the log.
LogFields = golog.Fields
// LogRow is the log per line callback.
LogRow = golog.Log
)
// Prepare A prepared function is passed in for initialization.
func Prepare(f func(Initiator)) {
internal.Prepare(f)
}
// NewUnitTest Unit testing tools.
func NewUnitTest() UnitTest {
return internal.NewUnitTest()
}
// DefaultConfiguration Proxy a call to iris.DefaultConfiguration
func DefaultConfiguration() iris.Configuration {
return iris.DefaultConfiguration()
}