|
1 | 1 | package action |
2 | 2 |
|
3 | | -type DskAction string |
| 3 | +type DskTask string |
4 | 4 |
|
5 | 5 | var ( |
6 | | - ActionListDsk DskAction = "list" |
7 | | - ActionFormatDsk DskAction = "format" |
8 | | - ActionDisplayHexaFileDsk DskAction = "hexa" |
9 | | - ActionDesassembleFileDsk DskAction = "desassemble" |
10 | | - ActionListBasic DskAction = "listbasic" |
11 | | - ActionAnalyseDsk DskAction = "analyze" |
12 | | - ActionPutFileDsk DskAction = "put" |
13 | | - ActionRemoveFileDsk DskAction = "remove" |
14 | | - ActionGetFileDsk DskAction = "get" |
15 | | - ActionGetAllFileDsk DskAction = "getall" |
16 | | - ActionAsciiFileDsk DskAction = "ascii" |
17 | | - ActionRawExportDsk DskAction = "rawexport" |
18 | | - ActionRawImportDsk DskAction = "rawimport" |
19 | | - ActionFileinfoDsk DskAction = "info" |
| 6 | + ActionListDsk DskTask = "list" |
| 7 | + ActionFormatDsk DskTask = "format" |
| 8 | + ActionDisplayHexaFileDsk DskTask = "hexa" |
| 9 | + ActionDesassembleFileDsk DskTask = "desassemble" |
| 10 | + ActionListBasic DskTask = "listbasic" |
| 11 | + ActionAnalyseDsk DskTask = "analyze" |
| 12 | + ActionPutFileDsk DskTask = "put" |
| 13 | + ActionRemoveFileDsk DskTask = "remove" |
| 14 | + ActionGetFileDsk DskTask = "get" |
| 15 | + ActionGetAllFileDsk DskTask = "getall" |
| 16 | + ActionAsciiFileDsk DskTask = "ascii" |
| 17 | + ActionRawExportDsk DskTask = "rawexport" |
| 18 | + ActionRawImportDsk DskTask = "rawimport" |
| 19 | + ActionFileinfoDsk DskTask = "info" |
20 | 20 | ) |
21 | 21 |
|
22 | | -type DskActionFile struct { |
23 | | - File string |
24 | | - a DskAction |
| 22 | +type DskTaskFile struct { |
| 23 | + File string |
| 24 | + Folder string |
| 25 | + a DskTask |
25 | 26 | } |
26 | 27 |
|
27 | | -type DskActions struct { |
28 | | - a []DskActionFile |
| 28 | +type DskTasks struct { |
| 29 | + a []DskTaskFile |
29 | 30 | } |
30 | 31 |
|
31 | | -func NewDskActions() *DskActions { |
32 | | - return &DskActions{ |
33 | | - a: []DskActionFile{}, |
| 32 | +func NewDskTasks() *DskTasks { |
| 33 | + return &DskTasks{ |
| 34 | + a: []DskTaskFile{}, |
34 | 35 | } |
35 | 36 | } |
36 | 37 |
|
37 | | -func (a *DskActions) WithActionListDsk(path string, isSet bool) *DskActions { |
| 38 | +func (a *DskTasks) WithActionListDsk(path string, isSet bool) *DskTasks { |
38 | 39 | if isSet { |
39 | | - a.a = append(a.a, DskActionFile{File: path, a: ActionListDsk}) |
| 40 | + a.a = append(a.a, DskTaskFile{File: path, a: ActionListDsk}) |
40 | 41 | } |
41 | 42 | return a |
42 | 43 | } |
43 | 44 |
|
44 | | -func (a *DskActions) WithActionFormatDsk(path string, isSet bool) *DskActions { |
| 45 | +func (a *DskTasks) WithActionFormatDsk(path string, isSet bool) *DskTasks { |
45 | 46 | if isSet { |
46 | | - a.a = append(a.a, DskActionFile{File: path, a: ActionFormatDsk}) |
| 47 | + a.a = append(a.a, DskTaskFile{File: path, a: ActionFormatDsk}) |
47 | 48 | } |
48 | 49 | return a |
49 | 50 | } |
50 | | -func (a *DskActions) WithActionDisplayHexaFileDsk(path string, isSet bool) *DskActions { |
| 51 | +func (a *DskTasks) WithActionDisplayHexaFileDsk(path string, isSet bool) *DskTasks { |
51 | 52 | if isSet { |
52 | | - a.a = append(a.a, DskActionFile{File: path, a: ActionDisplayHexaFileDsk}) |
| 53 | + a.a = append(a.a, DskTaskFile{File: path, a: ActionDisplayHexaFileDsk}) |
53 | 54 | } |
54 | 55 | return a |
55 | 56 | } |
56 | | -func (a *DskActions) WithActionDesassembleFileDsk(path string, isSet bool) *DskActions { |
| 57 | +func (a *DskTasks) WithActionDesassembleFileDsk(path string, isSet bool) *DskTasks { |
57 | 58 | if isSet { |
58 | | - a.a = append(a.a, DskActionFile{File: path, a: ActionDesassembleFileDsk}) |
| 59 | + a.a = append(a.a, DskTaskFile{File: path, a: ActionDesassembleFileDsk}) |
59 | 60 | } |
60 | 61 | return a |
61 | 62 | } |
62 | | -func (a *DskActions) WithActionListBasic(path string, isSet bool) *DskActions { |
| 63 | +func (a *DskTasks) WithActionListBasic(path string, isSet bool) *DskTasks { |
63 | 64 | if isSet { |
64 | | - a.a = append(a.a, DskActionFile{File: path, a: ActionListBasic}) |
| 65 | + a.a = append(a.a, DskTaskFile{File: path, a: ActionListBasic}) |
65 | 66 | } |
66 | 67 | return a |
67 | 68 | } |
68 | | -func (a *DskActions) WithActionAnalyseDsk(path string, isSet bool) *DskActions { |
| 69 | +func (a *DskTasks) WithActionAnalyseDsk(path string, isSet bool) *DskTasks { |
69 | 70 | if isSet { |
70 | | - a.a = append(a.a, DskActionFile{File: path, a: ActionAnalyseDsk}) |
| 71 | + a.a = append(a.a, DskTaskFile{File: path, a: ActionAnalyseDsk}) |
71 | 72 | } |
72 | 73 | return a |
73 | 74 | } |
74 | | -func (a *DskActions) WithActionPutFileDsk(path string, isSet bool) *DskActions { |
| 75 | +func (a *DskTasks) WithActionPutFileDsk(path string, isSet bool) *DskTasks { |
75 | 76 | if isSet { |
76 | | - a.a = append(a.a, DskActionFile{File: path, a: ActionPutFileDsk}) |
| 77 | + a.a = append(a.a, DskTaskFile{File: path, a: ActionPutFileDsk}) |
77 | 78 | } |
78 | 79 | return a |
79 | 80 | } |
80 | | -func (a *DskActions) WithActionRemoveFileDsk(path string, isSet bool) *DskActions { |
| 81 | +func (a *DskTasks) WithActionRemoveFileDsk(path string, isSet bool) *DskTasks { |
81 | 82 | if isSet { |
82 | | - a.a = append(a.a, DskActionFile{File: path, a: ActionRemoveFileDsk}) |
| 83 | + a.a = append(a.a, DskTaskFile{File: path, a: ActionRemoveFileDsk}) |
83 | 84 | } |
84 | 85 | return a |
85 | 86 | } |
86 | | -func (a *DskActions) WithActionGetFileDsk(path string, isSet bool) *DskActions { |
| 87 | +func (a *DskTasks) WithActionGetFileDsk(path string, isSet bool) *DskTasks { |
87 | 88 | if isSet { |
88 | | - a.a = append(a.a, DskActionFile{File: path, a: ActionGetFileDsk}) |
| 89 | + a.a = append(a.a, DskTaskFile{File: path, a: ActionGetFileDsk}) |
89 | 90 | } |
90 | 91 | return a |
91 | 92 | } |
92 | | -func (a *DskActions) WithActionAsciiFileDsk(path string, isSet bool) *DskActions { |
| 93 | +func (a *DskTasks) WithActionAsciiFileDsk(path string, isSet bool) *DskTasks { |
93 | 94 | if isSet { |
94 | | - a.a = append(a.a, DskActionFile{File: path, a: ActionAsciiFileDsk}) |
| 95 | + a.a = append(a.a, DskTaskFile{File: path, a: ActionAsciiFileDsk}) |
95 | 96 | } |
96 | 97 | return a |
97 | 98 | } |
98 | | -func (a *DskActions) WithActionRawExportDsk(path string, isSet bool) *DskActions { |
| 99 | +func (a *DskTasks) WithActionRawExportDsk(path string, isSet bool) *DskTasks { |
99 | 100 | if isSet { |
100 | | - a.a = append(a.a, DskActionFile{File: path, a: ActionRawExportDsk}) |
| 101 | + a.a = append(a.a, DskTaskFile{File: path, a: ActionRawExportDsk}) |
101 | 102 | } |
102 | 103 | return a |
103 | 104 | } |
104 | | -func (a *DskActions) WithActionRawImportDsk(path string, isSet bool) *DskActions { |
| 105 | +func (a *DskTasks) WithActionRawImportDsk(path string, isSet bool) *DskTasks { |
105 | 106 | if isSet { |
106 | | - a.a = append(a.a, DskActionFile{File: path, a: ActionRawImportDsk}) |
| 107 | + a.a = append(a.a, DskTaskFile{File: path, a: ActionRawImportDsk}) |
107 | 108 | } |
108 | 109 | return a |
109 | 110 | } |
110 | | -func (a *DskActions) WithActionFileinfoDsk(path string, isSet bool) *DskActions { |
| 111 | +func (a *DskTasks) WithActionFileinfoDsk(path string, isSet bool) *DskTasks { |
111 | 112 | if isSet { |
112 | | - a.a = append(a.a, DskActionFile{File: path, a: ActionFileinfoDsk}) |
| 113 | + a.a = append(a.a, DskTaskFile{File: path, a: ActionFileinfoDsk}) |
113 | 114 | } |
114 | 115 | return a |
115 | 116 | } |
116 | 117 |
|
117 | | -func (a *DskActions) WithActionGetAllFileDsk(path string, isSet bool) *DskActions { |
| 118 | +func (a *DskTasks) WithActionGetAllFileDsk(path string, isSet bool) *DskTasks { |
118 | 119 | if isSet { |
119 | | - a.a = append(a.a, DskActionFile{File: path, a: ActionGetAllFileDsk}) |
| 120 | + a.a = append(a.a, DskTaskFile{Folder: path, File: path, a: ActionGetAllFileDsk}) |
120 | 121 | } |
121 | 122 | return a |
122 | 123 | } |
0 commit comments