ExecuteCreate creates the configured entry in the main configuration.
()
| 25 | |
| 26 | // ExecuteCreate creates the configured entry in the main configuration. |
| 27 | func (cc *CreateController) ExecuteCreate() { |
| 28 | switch cc.createType { |
| 29 | case TypeUsers: |
| 30 | cc.configuration.Main.Users = utils.RemoveDuplicate( |
| 31 | append(cc.configuration.Main.Users, cc.createContent)) |
| 32 | cc.updateConfig() |
| 33 | case TypePorts: |
| 34 | cc.configuration.Main.Ports = utils.RemoveDuplicate( |
| 35 | append(cc.configuration.Main.Ports, cc.createContent)) |
| 36 | cc.updateConfig() |
| 37 | case TypePasswords: |
| 38 | cc.configuration.Main.Passwords = utils.RemoveDuplicate( |
| 39 | append(cc.configuration.Main.Passwords, cc.createContent)) |
| 40 | cc.updateConfig() |
| 41 | case TypeKeys: |
| 42 | cc.configuration.Main.Keys = utils.RemoveDuplicate( |
| 43 | append(cc.configuration.Main.Keys, cc.createContent)) |
| 44 | cc.updateConfig() |
| 45 | case TypeCaches: |
| 46 | if cc.createCaches() { |
| 47 | cc.updateConfig() |
| 48 | } |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | func (cc *CreateController) updateConfig() { |
| 53 | displayContent := cc.createContent |