forked from anz-bank/sysl
/
types.go
102 lines (87 loc) · 1.9 KB
/
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
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
100
101
102
package command
import (
sysl "github.com/Joshcarp/sysl/pkg/sysl"
"github.com/sirupsen/logrus"
"github.com/spf13/afero"
"gopkg.in/alecthomas/kingpin.v2"
)
type Visitor interface {
Visit(Element) error
}
type Element interface {
Accept(Visitor) error
}
type EndpointLabelerParam struct {
EndpointName string
Human string
HumanSender string
NeedsInt string
Args string
Patterns string
Controls string
Attrs map[string]*sysl.Attribute
}
type EndpointLabeler interface {
LabelEndpoint(*EndpointLabelerParam) string
}
type AppLabeler interface {
LabelApp(appName, controls string, attrs map[string]*sysl.Attribute) string
}
type ClassLabeler interface {
LabelClass(className string) string
}
type VarManager interface {
UniqueVarForAppName(appName string) string
}
type CmdContextParamCodegen struct {
rootTransform string
transform string
grammar string
start string
disableValidator bool
}
type CmdContextParamSeqgen struct {
endpointFormat string
appFormat string
title string
output string
endpointsFlag []string
appsFlag []string
blackboxesFlag map[string]string
blackboxes [][]string
group string
}
type CmdContextParamIntgen struct {
title string
output string
project string
filter string
exclude []string
clustered bool
epa bool
}
type CmdContextParamDatagen struct {
title string
output string
project string
filter string
classFormat string
}
type CmdDatabaseScriptParams struct {
title string
outputDir string
appNames string
dbType string
}
type ExecuteArgs struct {
Modules []*sysl.Module
Filesystem afero.Fs
Logger *logrus.Logger
DefaultAppName string
}
type Command interface {
Configure(*kingpin.Application) *kingpin.CmdClause
Execute(ExecuteArgs) error
Name() string
MaxSyslModule() int
}