()
| 62 | } |
| 63 | |
| 64 | func (cc *CreateController) createCaches() bool { |
| 65 | var newCache CacheContent |
| 66 | if err := json.Unmarshal([]byte(cc.createContent), &newCache); err != nil { |
| 67 | utils.Errorln("Cache's JSON unmarshal failed.") |
| 68 | return false |
| 69 | } |
| 70 | cc.configuration.ServerLists = append(cc.configuration.ServerLists, |
| 71 | config.ServerListConfig{ |
| 72 | IP: newCache.IP, |
| 73 | Port: newCache.Port, |
| 74 | User: newCache.User, |
| 75 | Password: newCache.Password, |
| 76 | Alias: newCache.Alias, |
| 77 | }, |
| 78 | ) |
| 79 | return true |
| 80 | } |
| 81 | |
| 82 | // NewCreateController creates a new CreateController for the specified type and content. |
| 83 | func NewCreateController(createType string, createContent string, |
no test coverage detected