-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathconfig.go
More file actions
121 lines (89 loc) · 3.2 KB
/
config.go
File metadata and controls
121 lines (89 loc) · 3.2 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package v8
import (
"github.com/v8platform/designer"
)
// LoadCfg получает команду загрузки конфигурации из файла
// Подробнее в пакете designer.LoadCfgOptions
func LoadCfg(file string, updateDBCfg ...designer.UpdateDBCfgOptions) designer.LoadCfgOptions {
command := designer.LoadCfgOptions{
File: file,
Designer: designer.NewDesigner(),
}
if len(updateDBCfg) > 0 {
command.UpdateDBCfg = &updateDBCfg[0]
}
return command
}
// LoadConfigFromFiles получает команду загрузки конфигурации из файлов каталога
func LoadConfigFromFiles(dir string, updateDBCfg ...designer.UpdateDBCfgOptions) designer.LoadConfigFromFiles {
command := designer.LoadConfigFromFiles{
Dir: dir,
Designer: designer.NewDesigner(),
}
if len(updateDBCfg) > 0 {
command.UpdateDBCfg = &updateDBCfg[0]
}
return command
}
// UpdateCfg получает команду обновления конфигурации из файла
// Подробнее в пакете designer.UpdateCfgOptions
func UpdateCfg(file string, force bool, updateDBCfg ...designer.UpdateDBCfgOptions) designer.UpdateCfgOptions {
command := designer.UpdateCfgOptions{
File: file,
Force: force,
Designer: designer.NewDesigner(),
}
if len(updateDBCfg) > 0 {
command.UpdateDBCfg = &updateDBCfg[0]
}
return command
}
// DumpCfg получает команду сохранения конфигурации в файл
func DumpCfg(file string) designer.DumpCfgOptions {
command := designer.DumpCfgOptions{
File: file,
Designer: designer.NewDesigner(),
}
return command
}
// DumpConfigToFiles получает команду сохранения конфигурации в файлы указанного каталога
func DumpConfigToFiles(dir string, force ...bool) designer.DumpConfigToFilesOptions {
command := designer.DumpConfigToFilesOptions{
Designer: designer.NewDesigner(),
Dir: dir,
}
if len(force) > 0 {
command.Force = force[0]
}
return command
}
// GetChangesForConfigDump получает команду получения измнений конфигурации для указаного файла выгрузки конфигурации
func GetChangesForConfigDump(dir, file string, force ...bool) designer.GetChangesForConfigDumpOptions {
command := designer.GetChangesForConfigDumpOptions{
Designer: designer.NewDesigner(),
Dir: dir,
GetChanges: file,
}
if len(force) > 0 {
command.Force = force[0]
}
return command
}
// DisableCfgSupport получает команду отключение поддержки конфигурации
func DisableCfgSupport(force ...bool) designer.ManageCfgSupportOptions {
command := designer.ManageCfgSupportOptions{
Designer: designer.NewDesigner(),
DisableSupport: true,
}
if len(force) > 0 {
command.Force = force[0]
}
return command
}
// DisableCfgSupport получает команду возврата конфигруации к конфигурации БД
func RollbackCfg() designer.RollbackCfgOptions {
command := designer.RollbackCfgOptions{
Designer: designer.NewDesigner(),
}
return command
}