-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsettings.go
62 lines (53 loc) · 1.58 KB
/
settings.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
package generator
// Settings for Generator
type Settings interface {
FlowFuncPostfix() string
LocalInterfaceVarname() string
ImplFieldPostfix() string
NewImplFuncPrefix() string
ImplPostfix() string
InterfaceNamePostfix() string
}
type settings struct {
flowFuncPostfix string
localInterfaceVarname string
implFieldPostfix string
newImplFuncPrefix string
implPostfix string
interfaceNamePostfix string
}
// Returns a postfix for generated business flow function
func (s settings) FlowFuncPostfix() string {
return s.flowFuncPostfix
}
// Returns a service object name which uses in business flow function
func (s settings) LocalInterfaceVarname() string {
return s.localInterfaceVarname
}
// Returns a postifx which Effe adds to generated field
func (s settings) ImplFieldPostfix() string {
return s.implFieldPostfix
}
// Returns a prefix which Effe adds to generated business flow function
func (s settings) NewImplFuncPrefix() string {
return s.newImplFuncPrefix
}
// Returns a postfix which Effe adds to generated type for business flow function
func (s settings) ImplPostfix() string {
return s.implPostfix
}
// Returns a postfix which Effe adds to generated business flow function
func (s settings) InterfaceNamePostfix() string {
return s.interfaceNamePostfix
}
// Default values for settings
func DefaultSettigs() Settings {
return settings{
flowFuncPostfix: "Func",
localInterfaceVarname: "service",
implFieldPostfix: "FieldFunc",
newImplFuncPrefix: "New",
implPostfix: "Impl",
interfaceNamePostfix: "Service",
}
}